No need to handle '-' explicitly in getopt() loop.

Obtained from:	NetBSD
This commit is contained in:
Tim J. Robbins 2002-05-28 09:26:08 +00:00
parent bcd46c600a
commit fc7f17b1fe
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97393

View File

@ -84,11 +84,8 @@ main(argc, argv)
(void) setlocale(LC_ALL, "");
while ((ch = getopt(argc, argv, "-123i")) != -1)
while ((ch = getopt(argc, argv, "123i")) != -1)
switch(ch) {
case '-':
--optind;
goto done;
case '1':
flag1 = 0;
break;
@ -105,7 +102,7 @@ main(argc, argv)
default:
usage();
}
done: argc -= optind;
argc -= optind;
argv += optind;
if (argc != 2)