From 974ab3dd887985e3aa347f3c6521f819296396a0 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Sat, 16 Feb 2013 14:42:43 +0000 Subject: Imported Upstream version 8.21 --- src/nproc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/nproc.c') diff --git a/src/nproc.c b/src/nproc.c index a93ee536..5bd6610d 100644 --- a/src/nproc.c +++ b/src/nproc.c @@ -1,5 +1,5 @@ /* nproc - print the number of processors. - Copyright (C) 2009-2012 Free Software Foundation, Inc. + Copyright (C) 2009-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,6 +24,7 @@ #include "system.h" #include "error.h" #include "nproc.h" +#include "quote.h" #include "xstrtol.h" /* The official name of this program (e.g., no 'g' prefix). */ @@ -113,6 +114,12 @@ main (int argc, char **argv) } } + if (argc != optind) + { + error (0, 0, _("extra operand %s"), quote (argv[optind])); + usage (EXIT_FAILURE); + } + nproc = num_processors (mode); if (ignore < nproc) -- cgit v1.2.3