diff options
author | Keith Marshall <keithmarshall@@users.sf.net> | 2008-09-19 22:41:01 +0000 |
---|---|---|
committer | Keith Marshall <keithmarshall@@users.sf.net> | 2008-09-19 22:41:01 +0000 |
commit | acf5111a6f42c88183021a0779765731796ccbdd (patch) | |
tree | 6839bff1e3c0d52073b36a8164ad48a36c67427d /winsup/mingw | |
parent | be66dbed41083b50597a025239cfa857f972a221 (diff) | |
download | newlib-acf5111a6f42c88183021a0779765731796ccbdd.zip newlib-acf5111a6f42c88183021a0779765731796ccbdd.tar.gz newlib-acf5111a6f42c88183021a0779765731796ccbdd.tar.bz2 |
Fix MinGW-Bug [2119504].
Diffstat (limited to 'winsup/mingw')
-rw-r--r-- | winsup/mingw/ChangeLog | 10 | ||||
-rw-r--r-- | winsup/mingw/mingwex/getopt.c | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index 983e2b2..1037598 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 40016ad..86fc5c6 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. |