Skip to content

install: remove a to_string_lossy#13338

Open
oech3 wants to merge 1 commit into
uutils:mainfrom
oech3:inscfg
Open

install: remove a to_string_lossy#13338
oech3 wants to merge 1 commit into
uutils:mainfrom
oech3:inscfg

Conversation

@oech3

@oech3 oech3 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

lossy conversion is overkill just for checking last byte.

Comment thread src/uu/install/src/install.rs Outdated
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/tail-n0f (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/seq/seq-epipe is now being skipped but was previously passing.
Note: The gnu test tests/env/env-signal-handler was skipped on 'main' but is now failing.

@xtqqczze

Copy link
Copy Markdown
Contributor

As per #12306 (comment), this change might not be sound for Windows.

@oech3

oech3 commented Jul 10, 2026 via email

Copy link
Copy Markdown
Contributor Author

@xtqqczze

Copy link
Copy Markdown
Contributor

On further investigation, I think this change is sound as long as MAIN_SEPARATOR is guaranteed to be an ASCII character. In that case, its byte value is necessarily a non-continuation byte in the WTF-8 encoding used by Windows. It may be worth documenting this assumption in a comment to make it clear why this is sound.

cc: @ChrisDenton

@oech3

oech3 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

I think comment is not needed since

MAIN_SEPARATOR is guaranteed to be an ASCII character.

is trivial.

Comment thread src/uu/install/src/install.rs
@ChrisDenton

ChrisDenton commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

On further investigation, I think this change is sound as long as MAIN_SEPARATOR is guaranteed to be an ASCII character

Yes, ASCII is perfectly fine in all cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants