diff options
| author | Paul Eggert <eggert@cs.ucla.edu> | 2024-08-10 18:53:34 -0700 |
|---|---|---|
| committer | Paul Eggert <eggert@cs.ucla.edu> | 2024-08-10 19:30:01 -0700 |
| commit | ad094f20ed26c353003a6df48eabc05ea16df641 (patch) | |
| tree | d1f7f7a4e7fef40a3fdb45384a582b8c4b6ca74b | |
| parent | nl: support -l counts > 2**64 (diff) | |
| download | coreutils-ad094f20ed26c353003a6df48eabc05ea16df641.tar.gz coreutils-ad094f20ed26c353003a6df48eabc05ea16df641.zip | |
nproc: support --ignore counts > 2**64
* src/nproc.c (main): Allow --ignore arg to exceed 2**64.
| -rw-r--r-- | NEWS | 4 | ||||
| -rw-r--r-- | src/nproc.c | 3 |
2 files changed, 4 insertions, 3 deletions
@@ -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 018508908..7f6bb3223 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: |
