* 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.
stdbuf now works on AIX. Previously it would have been ineffective.
[bug introduced with the stdbuf program in coreutils-7.5]
+ 'tail -n NUM' no longer can output more than NUM lines if stdin
+ is a largish regular file with a nonzero initial offset, and grows
+ while 'tail' is reading it.
+ [This bug was present in "the beginning".]
+
'tail -f -n +NUM' no longer mishandles NUM values >= UINTMAX_MAX
when the input is seekable.
[bug introduced in coreutils-9.6]
start_pos to the end. */
xlseek (fd, start_pos, SEEK_SET, prettyname);
*read_pos = start_pos + dump_remainder (false, prettyname, fd,
- end_pos);
+ end_pos - start_pos);
goto free_buffer;
}
pos -= bufsize;