Correct the ``-unix X'' parsing (last time I only corrected

``-unitX''.

Pointed out twice by: Gert-Jan Vons <gert-jan@bigfoot.com>
This commit is contained in:
Brian Somers 1999-11-09 21:59:09 +00:00
parent 8c52203b20
commit 9d06928d0e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=53067

View File

@ -232,7 +232,9 @@ ProcessArgs(int argc, char **argv, struct switches *sw)
#endif
optc--; /* this option isn't exclusive */
} else if (strncmp(cp, "unit", 4) == 0) {
optc--; /* this option isn't exclusive */
if (cp[4] == '\0') {
optc--; /* nor is the argument */
if (++arg == argc) {
fprintf(stderr, "-unit: Expected unit number\n");
Usage();
@ -240,7 +242,6 @@ ProcessArgs(int argc, char **argv, struct switches *sw)
sw->unit = atoi(argv[arg]);
} else
sw->unit = atoi(cp + 4);
optc--; /* this option isn't exclusive */
} else if (strcmp(cp, "quiet") == 0) {
sw->quiet = 1;
optc--; /* this option isn't exclusive */