-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
date: fix handling of case-change flags in locale format specifiers #9897
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
base: main
Are you sure you want to change the base?
Conversation
230c85d to
3654036
Compare
|
GNU testsuite comparison: |
|
lot of jobs are failing |
bf1c296 to
f494fa5
Compare
|
GNU testsuite comparison: |
65b15f3 to
49f0f26
Compare
|
GNU testsuite comparison: |
49f0f26 to
0e2030a
Compare
|
Didn't realize there was already a PR for this when I was investigating the date gnu tests failures here: #10242 I ended up making a PR to Jiff to add support for these modifiers: BurntSushi/jiff#488 These are pre-made configs actually so theres nothing stopping us from making our own custom Config that has support for all of the modifiers and this way |
|
@CrazyRoka sorry, could you please rebase it ? |
- Add documentation for distribute_flag helper. - Add unit tests for flag distribution and locale expansion. - Add integration test for locale expansion with uppercase flag.
0e2030a to
f3ab2c5
Compare
Merging this PR will degrade performance by 3.91%
Performance Changes
Comparing Footnotes
|
|
GNU testsuite comparison: |
Previously, applying flags like
'^'(uppercase) or'#'(swap case) to locale-dependent specifiers (like%c,%x,%X) failed to affect the output. This occurred because the implementation passed these specifiers directly to the underlying formatter, which treats%cas a single unit without inheriting flags for its expanded components.For example,
LC_ALL=C TZ=UTC cargo run --bin coreutils date -d 2024-01-01 +%^cproduced "2024 M01 1, Mon 00:00:00", whereas GNUdateproduces "MON JAN 1 00:00:00 2024".This change pre-processes the format string to expand
%c,%x, and%Xusingnl_langinfo.This aligns behavior with GNU coreutils and we are now passing
subfmt-up1edge case intests/date/date.pl