OSDN Git Service

* lib/getopt.c (getopt_internal): Reset optind to 1 only if optreset
authorcorinna <corinna>
Wed, 7 Nov 2001 11:47:22 +0000 (11:47 +0000)
committercorinna <corinna>
Wed, 7 Nov 2001 11:47:22 +0000 (11:47 +0000)
is not set.

winsup/cygwin/ChangeLog
winsup/cygwin/lib/getopt.c

index f6f9788..78e345e 100644 (file)
@@ -1,3 +1,8 @@
+2001-11-07  Corinna Vinschen  <corinna@vinschen.de>
+
+       * lib/getopt.c (getopt_internal): Reset optind to 1 only if optreset
+       is not set.
+
 2001-11-06  Christopher Faylor  <cgf@redhat.com>
 
        * select.cc (fhandler_tty_slave::ready_for_read): Correct inverted
index c6f967d..effa5d7 100644 (file)
@@ -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)