From d7dc54ab264d3f539f4f08f8ebacfcb5037ac778 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 8 Feb 1999 18:59:00 +0000 Subject: back out last change, there was a reason for the dual getopt, ugly as it is... --- sbin/ipf/ipf.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'sbin') diff --git a/sbin/ipf/ipf.c b/sbin/ipf/ipf.c index b9926da8497..5a612c8f0dd 100644 --- a/sbin/ipf/ipf.c +++ b/sbin/ipf/ipf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipf.c,v 1.16 1999/02/08 18:29:11 millert Exp $ */ +/* $OpenBSD: ipf.c,v 1.17 1999/02/08 18:58:59 millert Exp $ */ /* * Copyright (C) 1993-1998 by Darren Reed. * @@ -45,7 +45,7 @@ #if !defined(lint) static const char sccsid[] = "@(#)ipf.c 1.23 6/5/96 (C) 1993-1995 Darren Reed"; -static const char rcsid[] = "@(#)$Id: ipf.c,v 1.16 1999/02/08 18:29:11 millert Exp $"; +static const char rcsid[] = "@(#)$Id: ipf.c,v 1.17 1999/02/08 18:58:59 millert Exp $"; #endif static void frsync __P((void)); @@ -57,6 +57,8 @@ extern char *index __P((const char *, int)); #endif extern char *optarg; +extern int optind; +extern int optreset; void zerostats __P((void)); int main __P((int, char *[])); @@ -88,6 +90,12 @@ char *argv[]; { int c; + while ((c = getopt(argc, argv, OPTS)) != -1) + if (c == '?') + usage(); + + optreset = 1; + optind = 1; while ((c = getopt(argc, argv, OPTS)) != -1) { switch (c) { @@ -147,9 +155,6 @@ char *argv[]; case 'Z' : zerostats(); break; - default : - usage(); - break; } } -- cgit v1.2.3