diff options
| author | Paul Eggert <eggert@cs.ucla.edu> | 2025-07-30 07:49:14 -0700 |
|---|---|---|
| committer | Paul Eggert <eggert@cs.ucla.edu> | 2025-08-03 19:48:05 -0700 |
| commit | fee8859750fecde7e1446a7dd82edf0389e51f31 (patch) | |
| tree | 601b02f24e42936fe39dbe6dd7baab767c57162f /scripts/git-hooks | |
| parent | tail: xlseek switch → table (diff) | |
| download | coreutils-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
