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-11-07 12:35:10 +00:00
2026-10-25 13:11:49 +00:00
2026-11-01 19:26:16 -08:00
2026-11-08 15:29:10 +00:00
2026-11-08 15:29:10 +00:00
2026-11-08 15:29:10 +00:00
2026-01-01 10:56:16 -08:00
2026-11-07 12:35:10 +00:00
2026-04-22 19:12:44 -07:00
2026-11-08 11:00:49 -08:00
2026-11-07 12:35:10 +00:00
2026-11-10 12:52:08 +00:00
2026-11-08 14:17:59 +00:00
2026-11-05 17:28:27 +00:00
2026-10-04 15:31:59 -07:00
2026-11-08 13:59:08 +00:00
2026-11-09 00:13:38 +00:00
2026-11-07 12:35:10 +00:00
2026-07-27 13:52:51 +01:00
2026-10-23 19:30:36 -07:00
2026-10-24 16:15:03 +01:00
2026-10-07 12:40:05 +01:00
2026-01-01 10:56:16 -08:00
2026-11-07 12:35:10 +00:00
2026-10-25 13:11:49 +00:00
2026-01-01 10:56:16 -08:00
2026-11-08 15:29:10 +00:00
2026-11-07 12:35:10 +00:00
2026-11-07 12:35:10 +00:00
2026-11-09 00:24:53 +00:00
2026-11-08 15:29:10 +00:00
2026-11-07 12:35:10 +00:00
2026-10-31 23:03:30 -07:00
2026-10-04 15:31:59 -07:00
2026-11-05 18:27:53 -08:00
2026-06-16 18:48:15 +01:00
2026-11-07 12:35:10 +00:00
2026-09-10 16:40:06 +01:00
2026-11-07 12:35:10 +00:00
2026-11-09 00:13:38 +00:00
2026-11-08 13:59:08 +00:00
2026-11-07 11:48:00 -08:00
2026-11-07 12:35:10 +00:00
2026-08-10 22:24:21 +01:00
2026-09-10 16:40:06 +01:00
2026-11-07 12:35:10 +00:00
2026-11-07 12:35:10 +00:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2026-11-02 23:43:14 +00:00
2026-11-06 17:06:42 -08:00
2026-06-30 18:26:51 +01:00
2026-11-09 00:24:53 +00:00
2026-11-09 16:09:49 -08:00
2026-11-07 12:35:10 +00:00
2026-10-21 12:54:34 +01:00
2026-03-04 17:57:54 +00:00
2026-11-09 00:19:10 +00:00
2026-10-25 13:11:49 +00:00
2026-07-26 12:44:01 -07:00
2026-10-30 14:36:49 +00:00
2026-04-10 11:09:10 +01:00
2026-11-06 23:55:28 +00:00
2026-08-13 22:32:56 -07:00
2026-04-09 21:25:27 +01:00
2026-11-07 12:35:10 +00:00
2026-11-09 00:13:34 +00:00
2026-11-07 12:35:10 +00:00
2026-08-18 22:12:31 -07:00
2026-01-01 10:56:16 -08:00
2026-01-01 10:56:16 -08:00
2015-11-06 16:40:42 +00:00
2026-01-01 10:56:16 -08:00
2011-04-13 11:18:48 +01:00
2012-09-14 10:20:03 +02:00
2006-08-16 20:11:42 +00:00
2026-11-10 12:52:08 +00:00
2015-11-10 13:03:33 +00:00
2026-01-01 10:56:16 -08:00
2026-01-01 20:50:59 -08:00
2021-05-12 22:14:11 +01:00