Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-11-07 14:47:23 +0300
committerCorinna Vinschen <corinna@vinschen.de>2001-11-07 14:47:23 +0300
commite2c07930f73d279e5c104e90a9a71ffb38c627cf (patch)
treeb10942129c872501b0d8b743655745b0fa7606b1
parentd0e406c6539d8c78515d85a253ea4b5365e57f3b (diff)
* lib/getopt.c (getopt_internal): Reset optind to 1 only if optreset
is not set.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/lib/getopt.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index f6f9788aa..78e345ec5 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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
diff --git a/winsup/cygwin/lib/getopt.c b/winsup/cygwin/lib/getopt.c
index c6f967d8e..effa5d774 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)