mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
tail: allow >=2**64 in traditional form
This better matches the treatment of POSIX form, e.g., ‘tail +Nc’ is now like ‘tail -c +N’ even when N is large. * src/tail.c: Don’t include xstrtol.h. (parse_obsolete_option): Treat numbers greater than UINTMAX_MAX as if they are UINTMAX_MAX. Parse the number by hand with saturating arithmetic; nowadays that’s simpler than using xstrtoumax. There is no need for a diagnostic now, as the error cannot happen any more. * tests/tail/tail.pl (obs-plus-c3): New test.
This commit is contained in:
@@ -29,6 +29,7 @@ my @tv = (
|
||||
#
|
||||
['obs-plus-c1', '+2c', 'abcd', 'bcd', 0],
|
||||
['obs-plus-c2', '+8c', 'abcd', '', 0],
|
||||
['obs-plus-c3', '+999999999999999999999999999999999999999999c', 'abcd', '', 0],
|
||||
['obs-c3', '-1c', 'abcd', 'd', 0],
|
||||
['obs-c4', '-9c', 'abcd', 'abcd', 0],
|
||||
['obs-c5', '-12c', 'x' . ('y' x 12) . 'z', ('y' x 11) . 'z', 0],
|
||||
|
||||
Reference in New Issue
Block a user