Skip to content

date: fix the strftime O and E modifier leaks #11656#11714

Open
tobyw21 wants to merge 2 commits intouutils:mainfrom
tobyw21:tobyw21-date-patch
Open

date: fix the strftime O and E modifier leaks #11656#11714
tobyw21 wants to merge 2 commits intouutils:mainfrom
tobyw21:tobyw21-date-patch

Conversation

@tobyw21
Copy link
Copy Markdown

@tobyw21 tobyw21 commented Apr 8, 2026

This PR fixes date: strftime with O and E modifiers. #11656

Changes

  • change regex in coreutils/src/uu/date/src/format_modifiers.rs:82 to %([_OE0^#+-]*)(\d*)(:*[a-zA-Z])
  • add tests for O and E modifiers

Limitations

None

Build requirements

Rust stable

Testing

Tested with make test

before

$ LC_ALL=C TZ=UTC target/debug/coreutils date -d '2024-06-15' '+%Om-%Oy-%Ol'
%Om-%Oy-%Ol
$ echo $?
0

after

$ LC_ALL=C TZ=UTC target/debug/coreutils date -d '2024-06-15' '+%Om-%Oy-%Ol'
06-24-12
$ echo $?
0

@tobyw21 tobyw21 force-pushed the tobyw21-date-patch branch from 32c54ca to 0af8e02 Compare April 8, 2026 12:43
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 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/pr/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/symlink (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)
Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/expand/bounded-memory is now passing!
Congrats! The gnu test tests/printf/printf-surprise is now passing!

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

GNU testsuite comparison:

GNU test failed: tests/tail/pipe-f2. tests/tail/pipe-f2 is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/tail/retry. tests/tail/retry is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/pr/bounded-memory (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/tail/tail-n0f is now being skipped but was previously passing.
Congrats! The gnu test tests/expand/bounded-memory is now passing!
Congrats! The gnu test tests/printf/printf-surprise is now passing!

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.

1 participant