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:
authorChristopher Faylor <me@cgf.cx>2001-11-07 21:33:19 +0300
committerChristopher Faylor <me@cgf.cx>2001-11-07 21:33:19 +0300
commit4962b1939570e13a9dafca640834f5002b89a1a8 (patch)
tree2238039a942a7289b36e8f9cece665323f2e045c
parenta4618e1c9712252af9d02bdb8db304362a29513a (diff)
* lib/getopt.c (getopt_internal): Reset optind to 1 only if optreset is notunlabeled-1.8.2
set.
-rw-r--r--winsup/cygwin/lib/getopt.c2
1 files changed, 1 insertions, 1 deletions
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)