Skip to content

split: accept overflow in --number option like GNU#10520

Open
naoNao89 wants to merge 1 commit intouutils:mainfrom
naoNao89:fix-split-overflow-10389
Open

split: accept overflow in --number option like GNU#10520
naoNao89 wants to merge 1 commit intouutils:mainfrom
naoNao89:fix-split-overflow-10389

Conversation

@naoNao89
Copy link
Contributor

Fixes #10389

where split rejected overflow values like 2^64. Now it matches GNU behavior by clamping to u64::MAX instead of erroring. Switched from parse_size_u64() to parse_size_u64_max() based on GNU's OVERFLOW_OK pattern. Added regression test to prevent future breakage.

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/split/fail. tests/split/fail is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)

Use parse_size_u64_max() instead of parse_size_u64() to clamp
overflow values to u64::MAX, matching GNU split behavior.

Fixes uutils#10389
@naoNao89 naoNao89 force-pushed the fix-split-overflow-10389 branch from 64ae96e to e31d74f Compare January 30, 2026 19:07
@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/split/fail. tests/split/fail is passing on 'main'. Maybe you have to rebase?

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.

split: invalid number of chunks: '18446744073709551616'

1 participant