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

NEWS
src/nproc.c

diff --git a/NEWS b/NEWS
index af9b88961f7b026670f07c89551786cb262d1cc2..dde9719db161220d7f20c76c373a929b71d59812 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -34,8 +34,8 @@ GNU coreutils NEWS                                    -*- outline -*-
 
 ** Improvements
 
-  'head -c NUM', 'head -n NUM' and 'nl -l NUM' no longer fail merely
-  because NUM stands for 2**64 or more.
+  'head -c NUM', 'head -n NUM', 'nl -l NUM' and 'nproc --ignore 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 0185089080bcea522d323bb4f842b71a36227b9f..7f6bb32234f1856af418700b79e4dfdf99d3158d 100644 (file)
@@ -101,7 +101,8 @@ main (int argc, char **argv)
           break;
 
         case IGNORE_OPTION:
-          ignore = xdectoumax (optarg, 0, ULONG_MAX, "", _("invalid number"),0);
+          ignore = xnumtoumax (optarg, 10, 0, ULONG_MAX, "",
+                               _("invalid number"), 0, XTOINT_MAX_QUIET);
           break;
 
         default: