tail: support counts > 2**64
commitcb11d2ab5e1911739004b0359ae4f5f6a643acf0
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 11 Aug 2024 02:02:44 +0000 (10 19:02 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 11 Aug 2024 02:30:01 +0000 (10 19:30 -0700)
treeaba0eb5cc126d6d25f4aa787bd558cc2447d15be
parent0f9e2719e0dd2366f0381daa832f9415f3162af2
tail: support counts > 2**64

* src/tail.c (tail_lines): If skipping all input, use lseek if
possible.
(parse_options): Allow counts to exceed 2**64.
(main): Don’t subtract 1 from UINTMAX_MAX, since it stands
for infinity in this context.
(main): Also don’t read anything when given infinite elisions.
* tests/tail/tail.pl: Adjust to match new behavior.  Rename err-5
test to big-c and expect the invocation to succeed, since ‘tail
-c99999999999999999999’ now succeeds instead of (unnecessarily)
failing.
NEWS
src/tail.c
tests/tail/tail.pl