]> git.ipfire.org Git - thirdparty/coreutils.git/commit
tail: fix tailing larger number of lines in regular files
authorHannes Braun <hannes@hannesbraun.net>
Wed, 24 Sep 2025 19:20:49 +0000 (21:20 +0200)
committerPádraig Brady <P@draigBrady.com>
Wed, 24 Sep 2025 21:37:18 +0000 (22:37 +0100)
commit914972e80dbf82aac9ffe3ff1f67f1028e1a788b
treeb4bc4c421729752a5c4e23893cb8a1f981f05e3a
parent0cc3e1bfb631b321e79b89d4f2862a2b62597c80
tail: fix tailing larger number of lines in regular files

* src/tail.c (file_lines): Seek to the previous block instead of the
beginning (or a little before) of the block that was just scanned.
Otherwise, the same block is read and scanned (at least partially)
again. This bug was introduced by commit v9.7-219-g976f8abc1.
* tests/tail/basic-seek.sh: Add a new test.
* tests/local.mk: Reference the new test.
* NEWS: mention the bug fix.
NEWS
src/tail.c
tests/local.mk
tests/tail/basic-seek.sh [new file with mode: 0755]