aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/git-hooks
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2025-07-30 07:49:14 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2025-08-03 19:48:05 -0700
commitfee8859750fecde7e1446a7dd82edf0389e51f31 (patch)
tree601b02f24e42936fe39dbe6dd7baab767c57162f /scripts/git-hooks
parenttail: xlseek switch → table (diff)
downloadcoreutils-fee8859750fecde7e1446a7dd82edf0389e51f31.tar.gz
coreutils-fee8859750fecde7e1446a7dd82edf0389e51f31.zip
tail: don’t output more lines than requested
* src/tail.c (file_lines): Fix an unlikely bug where ‘tail -n N’ could output more than N lines if standard input is a largish regular file with large initial offset that starts with (say) N-1 lines after the initial offset, but grows to N+1 lines between the fstat and read calls. In this case ‘tail -n N’ now outputs N-1 lines, not N+1; that is, it pretends the file grew after ‘tail’ read it. That is better than outputting more than N lines.
Diffstat (limited to 'scripts/git-hooks')
0 files changed, 0 insertions, 0 deletions