diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-12-08 03:14:30 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-12-08 03:14:30 +0000 |
commit | 8c6284ba25a79cb2700c47dfd7308350db1ca9ba (patch) | |
tree | 845c1ded27690f7c1b9fdf793e2ffc0a0cfa419d /usr.bin | |
parent | 5268aa7f3e1e85648f16bc183d3eca6825fa7a89 (diff) |
Avoid using "optind = 0" since its meaning to getopt() is implementation
dependent (and there is no good reason to use it in this case anyway).
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/xlint/xlint/xlint.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/usr.bin/xlint/xlint/xlint.c b/usr.bin/xlint/xlint/xlint.c index 497aaaaa4d3..dafa1f48dcd 100644 --- a/usr.bin/xlint/xlint/xlint.c +++ b/usr.bin/xlint/xlint/xlint.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xlint.c,v 1.10 2002/06/12 06:07:17 mpech Exp $ */ +/* $OpenBSD: xlint.c,v 1.11 2002/12/08 03:14:29 millert Exp $ */ /* $NetBSD: xlint.c,v 1.3 1995/10/23 14:29:30 jpo Exp $ */ /* @@ -33,7 +33,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: xlint.c,v 1.10 2002/06/12 06:07:17 mpech Exp $"; +static char rcsid[] = "$OpenBSD: xlint.c,v 1.11 2002/12/08 03:14:29 millert Exp $"; #endif #include <sys/param.h> @@ -357,11 +357,6 @@ main(argc, argv) (void)signal(SIGTERM, terminate); while (argc > optind) { - - argc -= optind; - argv += optind; - optind = 0; - c = getopt(argc, argv, "abceghil:no:prstuvxzC:D:FHI:L:U:V"); switch (c) { @@ -482,12 +477,13 @@ main(argc, argv) case -1: /* filename */ - fname(argv[0], argc == 1); + fname(argv[optind++], argc == 1); first = 0; - optind = 1; } } + argc -= optind; + argv += optind; if (first) usage(); |