printenv skips environment variables with invalid UTF-8#9702
printenv skips environment variables with invalid UTF-8#9702sylvestre wants to merge 1 commit intouutils:mainfrom
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.
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