diff options
author | 2002-12-08 06:40:44 +0000 | |
---|---|---|
committer | 2002-12-08 06:40:44 +0000 | |
commit | ee6f69c191f58982c32fa5125bc09c45c535cbb4 (patch) | |
tree | 4bd5a02d6d7ff26adbf00e4224a466ee65255bca | |
parent | Avoid setting optind to 0; drahn@ OK (diff) | |
download | wireguard-openbsd-ee6f69c191f58982c32fa5125bc09c45c535cbb4.tar.xz wireguard-openbsd-ee6f69c191f58982c32fa5125bc09c45c535cbb4.zip |
No need to try and catch "--" by hand, getopt() does it for us.
-rw-r--r-- | usr.bin/uniq/uniq.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.bin/uniq/uniq.c b/usr.bin/uniq/uniq.c index 448dac30f6c..5592c378d37 100644 --- a/usr.bin/uniq/uniq.c +++ b/usr.bin/uniq/uniq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uniq.c,v 1.10 2002/07/13 06:04:24 deraadt Exp $ */ +/* $OpenBSD: uniq.c,v 1.11 2002/12/08 06:40:44 millert Exp $ */ /* $NetBSD: uniq.c,v 1.7 1995/08/31 22:03:48 jtc Exp $ */ /* @@ -47,7 +47,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)uniq.c 8.3 (Berkeley) 5/4/95"; #endif -static char rcsid[] = "$OpenBSD: uniq.c,v 1.10 2002/07/13 06:04:24 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: uniq.c,v 1.11 2002/12/08 06:40:44 millert Exp $"; #endif /* not lint */ #include <errno.h> @@ -78,11 +78,8 @@ main(int argc, char *argv[]) char *prevline, *thisline, *p; obsolete(argv); - while ((ch = getopt(argc, argv, "-cdf:s:u")) != -1) + while ((ch = getopt(argc, argv, "cdf:s:u")) != -1) switch (ch) { - case '-': - --optind; - goto done; case 'c': cflag = 1; break; @@ -107,7 +104,7 @@ main(int argc, char *argv[]) usage(); } -done: argc -= optind; + argc -= optind; argv +=optind; /* If no flags are set, default is -d -u. */ |