Don't bother trying to handle "-" arguments ourselves, getopt(3) already
does this for us.
This commit is contained in:
parent
628855e758
commit
fc63032590
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97527
@ -83,11 +83,8 @@ main (argc, argv)
|
||||
(void) setlocale(LC_ALL, "");
|
||||
|
||||
obsolete(argv);
|
||||
while ((ch = getopt(argc, argv, "-cdif:s:u")) != -1)
|
||||
while ((ch = getopt(argc, argv, "cdif:s:u")) != -1)
|
||||
switch (ch) {
|
||||
case '-':
|
||||
--optind;
|
||||
goto done;
|
||||
case 'c':
|
||||
cflag = 1;
|
||||
break;
|
||||
@ -115,7 +112,7 @@ main (argc, argv)
|
||||
usage();
|
||||
}
|
||||
|
||||
done: argc -= optind;
|
||||
argc -= optind;
|
||||
argv +=optind;
|
||||
|
||||
/* If no flags are set, default is -d -u. */
|
||||
|
Loading…
Reference in New Issue
Block a user