The read builtin erroneously consumes null bytes

"Kerin Millar" <[email protected]> Fri, 19 Jun 2026 06:04:27 +0100
Newsgroups org.kernel.vger.dash
Message-ID <[email protected]>
Hi,

Consider the following test case. It demonstrates NUL being consumed by the read builtin, rather than by cat(1) as it should have been.

$ printf 'a\n\0bc' | dash -c 'read x; cat' | od -An -t x1 -c
  62  63
   b   c

This defect may be attributable to https://git.kernel.org/pub/scm/utils/dash/dash.git/tree/src/input.c?h=v0.5.13.4#n411.

Incidentally, it results in tests #5510, #5558 and #6020 failing for git v2.54.0.

-- 
Kerin Millar