Skip to content

touch: Fix leap second year overflow - #14214

Merged
sylvestre merged 1 commit into
uutils:mainfrom
mtvb:touch_year_overflow_fix
Aug 29, 2026
Merged

touch: Fix leap second year overflow#14214
sylvestre merged 1 commit into
uutils:mainfrom
mtvb:touch_year_overflow_fix

Conversation

@mtvb

@mtvb mtvb commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Replaced the panicking dt += 1.second() with dt.checked_add(1.second()), mapping the overflow case to the same USimpleError/invalid date format error every other unparseable -t value already produces.

Fixes #14212

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/inotify-dir-recreate (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)
Note: The gnu test tests/cut/bounded-memory is now being skipped but was previously passing.

@sylvestre
sylvestre merged commit 5b0d47a into uutils:main Aug 29, 2026
100 checks passed
@mtvb
mtvb deleted the touch_year_overflow_fix branch August 29, 2026 10:18
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.

touch: -t with leap second near max representable year panics

2 participants