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:
authorKeith Marshall <keithmarshall@@users.sf.net>2008-09-20 02:41:01 +0400
committerKeith Marshall <keithmarshall@@users.sf.net>2008-09-20 02:41:01 +0400
commitacf5111a6f42c88183021a0779765731796ccbdd (patch)
tree6839bff1e3c0d52073b36a8164ad48a36c67427d /winsup/mingw
parentbe66dbed41083b50597a025239cfa857f972a221 (diff)
Fix MinGW-Bug [2119504].
Diffstat (limited to 'winsup/mingw')
-rw-r--r--winsup/mingw/ChangeLog10
-rw-r--r--winsup/mingw/mingwex/getopt.c4
2 files changed, 12 insertions, 2 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog
index 983e2b23c..1037598ea 100644
--- a/winsup/mingw/ChangeLog
+++ b/winsup/mingw/ChangeLog
@@ -1,5 +1,15 @@
2008-09-19 Keith Marshall <keithmarshall@users.sourceforge.net>
+ Fix MinGW-Bug [2119504].
+ (Reported by Peiyuan Song).
+
+ * mingwex/getopt.c (getopt_resolved): Do not overwrite...
+ (*retindex): ...this already correctly assigned return variable...
+ (opt[index].val): ...with this; this should have been assigned to...
+ (*opt[index].flag) [opt[index].flag != NULL]: ...this instead.
+
+2008-09-19 Keith Marshall <keithmarshall@users.sourceforge.net>
+
Fix MinGW-Bug [2117379].
(Reported by Peiyuan Song).
diff --git a/winsup/mingw/mingwex/getopt.c b/winsup/mingw/mingwex/getopt.c
index 40016ad3c..86fc5c615 100644
--- a/winsup/mingw/mingwex/getopt.c
+++ b/winsup/mingw/mingwex/getopt.c
@@ -283,12 +283,12 @@ struct option *opt, int index, int *retindex, const CHAR *optstring )
/* when the caller has provided a return buffer ...
*/
- if( retindex != NULL )
+ if( opt[index].flag != NULL )
{
/* ... then we place the proper return value there,
* and return a status code of zero ...
*/
- *retindex = opt[index].val;
+ *(opt[index].flag) = opt[index].val;
return 0;
}
/* ... otherwise, the return value becomes the status code.