aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2025-07-28 11:24:38 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2025-08-03 19:48:04 -0700
commit6439858056d9bc9dd7411df583e60854ace41d17 (patch)
tree2bdcf71d4ac19867352f436800383380724243d7 /tests
parenttail: check OFF_T_MAX vs COPY_A_BUFFER (diff)
downloadcoreutils-6439858056d9bc9dd7411df583e60854ace41d17.tar.gz
coreutils-6439858056d9bc9dd7411df583e60854ace41d17.zip
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.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/tail/tail.pl1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/tail/tail.pl b/tests/tail/tail.pl
index f972f3e2b..eeddc6b07 100755
--- a/tests/tail/tail.pl
+++ b/tests/tail/tail.pl
@@ -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],