(tail_bytes) [from_start]: For regular files, seek
authorJim Meyering <jim@meyering.net>
Thu, 27 Jul 1995 03:56:35 +0000 (03:56 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 27 Jul 1995 03:56:35 +0000 (03:56 +0000)
commit8c17f50aea64f125655602fe2c2efb8855e88d9d
tree4576f346cc5db8790f320fdfca64cf7b0de7a465
parent28e28e6d749747b1b77878d31308c665195283ca
(tail_bytes) [from_start]: For regular files, seek
relative to the initial input file pointer position, not
necessarily from the beginning of the file.
[!from_start]: Don't back up past the initial position of the
input file pointer.
(tail_lines): Call file_lines only if FD refers to a regular file
with its file pointer positioned at beginning of file.  Otherwise,
call pipe_lines.  This is a kludge.  Once there's a decent test
suite, fix this properly.
Before, (echo 1; echo 2) > k; sh -c 'read x; tail' < k
would output both lines of the input file even though the first had
already been read.  Reported by John Roll (john@panic.harvard.edu).
src/tail.c