From 4962b1939570e13a9dafca640834f5002b89a1a8 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 7 Nov 2001 18:33:19 +0000 Subject: * lib/getopt.c (getopt_internal): Reset optind to 1 only if optreset is not set. --- winsup/cygwin/lib/getopt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/lib/getopt.c b/winsup/cygwin/lib/getopt.c index c6f967d..effa5d7 100644 --- a/winsup/cygwin/lib/getopt.c +++ b/winsup/cygwin/lib/getopt.c @@ -214,7 +214,7 @@ getopt_internal(int nargc, char *const * nargv, const char *options) * XXX re-initialize optind to 0 and have getopt_long(3) * XXX properly function again. Work around this braindamage. */ - if (optind == 0) + if (optind == 0 && optreset == 0) optind = 1; if (optreset) -- cgit v1.1