From: Paul Eggert Date: Sun, 11 Aug 2024 01:53:34 +0000 (-0700) Subject: nproc: support --ignore counts > 2**64 X-Git-Tag: v9.6~189 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad094f20ed26c353003a6df48eabc05ea16df641;p=thirdparty%2Fcoreutils.git nproc: support --ignore counts > 2**64 * src/nproc.c (main): Allow --ignore arg to exceed 2**64. --- diff --git a/NEWS b/NEWS index af9b88961f..dde9719db1 100644 --- 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. diff --git a/src/nproc.c b/src/nproc.c index 0185089080..7f6bb32234 100644 --- a/src/nproc.c +++ b/src/nproc.c @@ -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: