tail: avoid infloop with -c on /dev/zero
commitfb543b6b82c1f3a20ff88f44cc3ed367bfe811b6
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 20 Apr 2024 04:44:32 +0000 (19 21:44 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 20 Apr 2024 04:45:43 +0000 (19 21:45 -0700)
tree72adee96baf0355860900b72f198a66ff4df1cbe
parent9ab1f9db94479eca4dd2c29b4e21550ff2bcd5bb
tail: avoid infloop with -c on /dev/zero

Problem reported by Ionut Nicula in:
https://bugs.gnu.org/70477
* src/tail.c (tail_bytes): Do not loop forever on commands
like 'tail -c 4096 /dev/zero'.
* tests/tail/tail-c.sh: Test this fix.
NEWS
src/tail.c
tests/tail/tail-c.sh