Skip to content

date: fix the strftime O and E modifier leaks #11656 (new)#11834

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

date: fix the strftime O and E modifier leaks #11656 (new)#11834
tobyw21 wants to merge 3 commits intouutils:mainfrom
tobyw21:tobyw21-date-patch

Conversation

@tobyw21
Copy link
Copy Markdown

@tobyw21 tobyw21 commented Apr 15, 2026

This is a new PR to a broken old PR #11714 and trying to address issue #11656.
This PR fixes date: strftime with O and E modifiers. Fixes #11656

Changes

  • coreutils/src/uu/date/src/format_modifiers.rs:105, in bytes matching, added O and E bytes match.
  • add tests for O and E modifiers with valid specifier and invalid specifiers according gnu date behaviours in the documentation

Limitations

Currently block the BrokenDownTime calling to_string_with_config if modifier E or O combines with invalid specifiers. It pre-checks if modifier is O or E, then skip formatting if modifier is E and specifier is not in '%c', '%C', '%x', '%X', '%y' and '%Y', or if modifier is O and specifier is in '%a', '%A', '%c', '%D', '%F', '%x' and '%X'. While Jiff does not support modifier E and O, this check is to be done outside of Jiff.

Build requirements

Rust stable

Testing

Tested with make test

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/tail/retry is no longer failing!
Congrats! The gnu test tests/expand/bounded-memory 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.

date: strftime O modifier leaks as literal in C locale

1 participant