Skip to content

i18n: filter out empty env variables#11238

Open
Juul-Mc-Goa wants to merge 4 commits intouutils:mainfrom
Juul-Mc-Goa:i18n_filter_null_env
Open

i18n: filter out empty env variables#11238
Juul-Mc-Goa wants to merge 4 commits intouutils:mainfrom
Juul-Mc-Goa:i18n_filter_null_env

Conversation

@Juul-Mc-Goa
Copy link

Make get_locale_from_env POSIX compliant by ignoring empty env variables.

Fixes #11136.

Make `get_locale_from_env` POSIX compliant by ignoring empty env variables.
@github-actions
Copy link

github-actions bot commented Mar 8, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/rm/many-dir-entries-vs-OOM is now passing!
Congrats! The gnu test tests/tail/pipe-f is now passing!

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/date/resolution (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tty/tty-eof (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/pr/bounded-memory is now being skipped but was previously passing.
Note: The gnu test tests/tail/tail-n0f is now being skipped but was previously passing.

@sylvestre
Copy link
Contributor

could you please add a test ? thanks

@Juul-Mc-Goa
Copy link
Author

I've added some tests for sort, but it assumes the host has hungarian locale installed.

Otherwise, I guess I could add a tests module inside uucore/src/lib/features/i18n/mod.rs that:

  1. uses the unsafe std::env::set_var to set env variables,
  2. calls get_locale_from_env and check that it is correct.

I'm not sure if the second solution is any better than the first.

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/unexpand/bounded-memory is now being skipped but was previously passing.
Congrats! The gnu test tests/rm/many-dir-entries-vs-OOM is now passing!
Congrats! The gnu test tests/seq/seq-epipe is now passing!
Note: The gnu test tests/env/env-signal-handler was skipped on 'main' but is now failing.

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.

sort is not conformant with POSIX (collation)

2 participants