diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | getopt.c | 12 | ||||
-rw-r--r-- | getopt1.c | 5 |
3 files changed, 21 insertions, 3 deletions
@@ -1,3 +1,10 @@ +2012-03-20 Arnold D. Robbins <arnold@skeeve.com> + + * getopt.c: Undef ELIDE_CODE for gawk. + (_getopt_internal_r): Init first.needs_free to 0. In test for -W + move executable code to after declarations for C90 compilers. + * getopt1.c: Undef ELIDE_CODE for gawk. + 2012-03-16 Arnold D. Robbins <arnold@skeeve.com> * getopt.c, getopt.h, getopt1.c, getopt_int.h, regcomp.c, @@ -48,6 +48,11 @@ # endif #endif +/* !@#$%^&*() !!!!!!!! */ +#ifdef GAWK +#undef ELIDE_CODE +#endif + #ifndef ELIDE_CODE @@ -582,6 +587,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring, struct option_list first; first.p = pfound; first.next = ambig_list; + first.needs_free = 0; ambig_list = &first; #if defined _LIBC @@ -877,9 +883,6 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring, /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { - if (longopts == NULL) - goto no_longs; - char *nameend; const struct option *p; const struct option *pfound = NULL; @@ -888,6 +891,9 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring, int indfound = 0; int option_index; + if (longopts == NULL) + goto no_longs; + /* This is an option that requires an argument. */ if (*d->__nextchar != '\0') { @@ -45,6 +45,11 @@ #endif #endif +/* !@#$%^&*() !!!!!!!! */ +#ifdef GAWK +#undef ELIDE_CODE +#endif + #ifndef ELIDE_CODE |