summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-12-08 06:40:45 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-12-08 06:40:45 +0000
commit69e344b082cea0f625076588982eb7fd82d04bed (patch)
treea8aa79075375bb59de300ab8964d916114e02345
parentf07813fb45bc93c7a494a5d52dc2ec6f29a9d19f (diff)
No need to try and catch "--" by hand, getopt() does it for us.
-rw-r--r--usr.bin/uniq/uniq.c11
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. */