mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-04 15:40:44 +00:00
ps: handle incorrect -D values
I just noticed a slight issue with the '-D' option. Basically, I accidentally typed something along the lines of: ps -Dboth-p303 I.E. missing out the "space". Instead of giving an error, it behaved as if I'd just typed "ps". Looking at bin/ps/ps.c, where the -D option is parsed, it doesn't error-out if there is no valid match. This commit fixes the bug.
This commit is contained in:
parent
1314d14c32
commit
3f0b80bc15
|
@ -263,6 +263,8 @@ main(int argc, char *argv[])
|
||||||
else if (len <= 4 &&
|
else if (len <= 4 &&
|
||||||
strncasecmp(optarg, "both", len) == 0)
|
strncasecmp(optarg, "both", len) == 0)
|
||||||
directions |= BOTH;
|
directions |= BOTH;
|
||||||
|
else
|
||||||
|
usage();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'd':
|
case 'd':
|
||||||
|
|
Loading…
Reference in a new issue