From 586068906c48dc57b7ebd784efe0dfcb0c2b4be9 Mon Sep 17 00:00:00 2001 From: tjr Date: Fri, 7 Jun 2002 02:35:21 +0000 Subject: No need to check for "-" explicitly in getopt() loop. --- usr.bin/cmp/cmp.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/usr.bin/cmp/cmp.c b/usr.bin/cmp/cmp.c index 1184abe..7a60ee9 100644 --- a/usr.bin/cmp/cmp.c +++ b/usr.bin/cmp/cmp.c @@ -72,7 +72,7 @@ main(argc, argv) int ch, fd1, fd2, special; const char *file1, *file2; - while ((ch = getopt(argc, argv, "-lsxz")) != -1) + while ((ch = getopt(argc, argv, "lsxz")) != -1) switch (ch) { case 'l': /* print all differences */ lflag = 1; @@ -88,14 +88,10 @@ main(argc, argv) case 'z': /* compare size first */ zflag = 1; break; - case '-': /* stdin (must be after options) */ - --optind; - goto endargs; case '?': default: usage(); } -endargs: argv += optind; argc -= optind; -- cgit v1.1