-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
printenv skips environment variables with invalid UTF-8 #9702
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
|
GNU testsuite comparison: |
7bc8beb to
8c5873a
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
| #[cfg(unix)] | ||
| use std::ffi::OsString; | ||
| #[cfg(unix)] | ||
| use std::os::unix::ffi::OsStringExt; |
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 would move the imports to the test function, otherwise there are "unused import" warnings on Android and the BSDs.
|
I was thinking that for most of the code we can use a helper function like this: So everything can be kept as OsString, then in all of the functions they have the same code path without having the inline cfg stuff. Would be good to have most of our code move away from String by default through this too |
|
Hey this helper function actually already exists in: write_all_os coreutils/src/uucore/src/lib/mods/display.rs Line 115 in 16f7350
|
|
To make an example of how it could be used here I made a PR doing the similar thing for the env command: #9144 Makes the implementation way smaller compared to the inlining |
|
I think you accidentally referenced the |
closes: #9701