Skip to content

fix(numfmt): Read lines only up to null byte (as GNU does)#11146

Merged
cakebaker merged 4 commits intouutils:mainfrom
FidelSch:numfmt_null_byte
Mar 2, 2026
Merged

fix(numfmt): Read lines only up to null byte (as GNU does)#11146
cakebaker merged 4 commits intouutils:mainfrom
FidelSch:numfmt_null_byte

Conversation

@FidelSch
Copy link
Copy Markdown
Contributor

@FidelSch FidelSch commented Feb 27, 2026

Fixes #11109

In cases such as "1000\x002000\n3000" numfmt outputs "1000\n3000\n", strongly suggesting it reads input until encountering a null byte, which makes sense in a C context.

Should now mimic this behavior.

Added integration tests for this as well

@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)
Skipping an intermittent issue tests/tail/follow-name (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/inotify-dir-recreate (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/tail/tail-n0f is now passing!

@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)
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/rm/many-dir-entries-vs-OOM is now being skipped but was previously passing.
Congrats! The gnu test tests/tail/tail-n0f is now passing!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Feb 27, 2026

Merging this PR will degrade performance by 4.27%

❌ 1 regressed benchmark
✅ 293 untouched benchmarks
⏩ 42 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation shuf_input_range[1000000] 84.2 ms 88 ms -4.27%

Comparing FidelSch:numfmt_null_byte (fb271c2) with main (ba94c69)

Open in CodSpeed

Footnotes

  1. 42 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 1, 2026

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/date/resolution (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)
Congrats! The gnu test tests/rm/isatty is no longer failing!
Note: The gnu test tests/tail/pipe-f is now being skipped but was previously passing.

@cakebaker cakebaker merged commit 995c6dc into uutils:main Mar 2, 2026
158 of 159 checks passed
@cakebaker
Copy link
Copy Markdown
Contributor

Thanks!

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.

echo -e "3\0" | numfmt fails

2 participants