]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
nl: support -l counts > 2**64
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 11 Aug 2024 01:51:50 +0000 (18:51 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 11 Aug 2024 02:30:01 +0000 (19:30 -0700)
* src/nl.c (main): Allow -l arg to exceed 2**64.

NEWS
src/nl.c

diff --git a/NEWS b/NEWS
index 725064c9d463713229206497efc6a93858c0fbd2..af9b88961f7b026670f07c89551786cb262d1cc2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -34,8 +34,8 @@ GNU coreutils NEWS                                    -*- outline -*-
 
 ** Improvements
 
-  'head -c NUM' and 'head -n NUM' no longer fail merely because NUM
-  stands for 2**64 or more.
+  'head -c NUM', 'head -n NUM' and 'nl -l NUM' no longer fail merely
+  because NUM stands for 2**64 or more.
 
   sort operates more efficiently when used on pseudo files with
   an apparent size of 0, like those in /proc.
index b30579b4b3b971c8c47d42515a176b081398abd1..bf72373a89b1e6b76b7a03e2fa0170f01aa14634 100644 (file)
--- a/src/nl.c
+++ b/src/nl.c
@@ -533,7 +533,7 @@ main (int argc, char **argv)
         case 'l':
           blank_join = xnumtoimax (optarg, 10, 1, INTMAX_MAX, "",
                                    _("invalid line number of blank lines"),
-                                   0, XTOINT_MIN_RANGE);
+                                   0, XTOINT_MIN_RANGE | XTOINT_MAX_QUIET);
           break;
         case 's':
           separator_str = optarg;