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:
Diffstat (limited to 'winsup/cygwin/lib/getopt.c')
-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)