-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Allow non-utf8 paths name as input for most of the programs #8457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
sylvestre
commented
Aug 9, 2025
- add a fuzzer to verify that we don't regress in the future
GNU testsuite comparison:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: didn't review fuzzer, went all to way to expand
.
That's... a huge amount of work, thanks! I'll keep reviewing another day ,-P
GNU testsuite comparison:
|
GNU testsuite comparison:
|
GNU testsuite comparison:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expand->pathchk
more( | ||
InputType::File(BufReader::new(opened_file)), | ||
length > 1, | ||
file.to_str(), | ||
next_file.copied(), | ||
Some(&file.to_string_lossy()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should fix more
and Pager
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it requires a bunch of changes, ok if I do that in a different PR ?
(and i don't think i regressed the current state)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: Reviewed everything until the tests.
writeln!( | ||
stdout, | ||
"{sum:0width$} {blocks:width$} {}", | ||
file.to_string_lossy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is technically wrong, you should print the bytes (but you could just add a TODO).
GNU testsuite comparison:
|
Fixes issue introduced in b965c94 where switching from NonEmptyStringValueParser to OsString parser removed validation that arguments cannot be empty strings. - Add custom NonEmptyOsStringParser that validates OsString is not empty - Use the parser for FILES, --relative-to, and --relative-base arguments - Add test case to verify empty strings are rejected with exit code 1 - Fixes GNU realpath test failure
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
Co-authored-by: Nicolas Boichat <nicolas@boichat.ch>
GNU testsuite comparison:
|
GNU testsuite comparison:
|
GNU testsuite comparison:
|
Good work :) |