summaryrefslogtreecommitdiff
path: root/src/nice.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1993-11-27 21:59:45 +0000
committerJim Meyering <jim@meyering.net>1993-11-27 21:59:45 +0000
commit80d70870f52674ecb7e1dd6f7c517d689ab6be1f (patch)
treeb5e28b199e16250dac874c615a82664222a2e5f7 /src/nice.c
parent3ea7d7295764819b98923ca2ac9fc03e24932f1b (diff)
downloadcoreutils-80d70870f52674ecb7e1dd6f7c517d689ab6be1f.tar.xz
* (main): If an adjustment is specified, but no command is
given, give a diagnostic in addition to the usage message. (isinteger): Accept a leading `+'.
Diffstat (limited to 'src/nice.c')
-rw-r--r--src/nice.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nice.c b/src/nice.c
index 94f750eb5..ca989cda5 100644
--- a/src/nice.c
+++ b/src/nice.c
@@ -125,7 +125,10 @@ main (argc, argv)
if (optind == argc)
{
if (adjustment_given)
- usage (1);
+ {
+ error (0, 0, "a command must be given with an adjustment");
+ usage (1);
+ }
/* No command given; print the priority. */
errno = 0;
current_priority = GET_PRIORITY ();
@@ -157,7 +160,7 @@ static int
isinteger (s)
char *s;
{
- if (*s == '-')
+ if (*s == '-' || *s == '+')
++s;
if (*s == 0)
return 0;