Files
coreutils/tests
Pádraig Brady f66f9b1146 cut,expand,fold,unexpand: fix handling of multi-byte with short reads
This change is performance neutral as tested with:
 $ yes $(yes eeeaae | head -n10K | paste -s -d,) | head -n10K > ll.in
 $ hyperfine src/cut{,.orig}' -f10 -w ll.in >/dev/null'

* gl/lib/mbbuf.h (mbbuf_fill): Repeat the mbbuf_topup(), i.e. the read()
if the previous run didn't read enough.  Note we add the explicit
common case short-circuit to avoid a 20% regression
for the test case above, with GCC 16.2 with -O3 -flto.
* tests/cut/mb-short-read.sh: A new test file.
* tests/local.mk: Reference the new test.
* NEWS: Mention the bug fix.

Discovered by Anthropic's OSS Scanner, as bug ANT-2026-JSCMJCN2.
2026-11-10 12:52:08 +00:00
..
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00