Commit 706bae5c authored by jani@hynda.(none)'s avatar jani@hynda.(none)

A compatibility fix in my_getopt for boolean variables. All of

these work now and do the same thing: --lower-case-table-names,
--lower-case-table-names=1, -O lower-case-table-names=1,
--set-variable=lower-case-table-names=1
parent a5edb200
...@@ -50265,6 +50265,9 @@ each individual 4.0.x release. ...@@ -50265,6 +50265,9 @@ each individual 4.0.x release.
@appendixsubsec Changes in release 4.0.3 (Aug 2002: Beta) @appendixsubsec Changes in release 4.0.3 (Aug 2002: Beta)
@itemize @bullet @itemize @bullet
@item Fixed all boolean type variables to work with the old syntax,
e.g. all of these work: --lower-case-table-names, --lower-case-table-names=1,
-O lower-case-table-names=1, --set-variable=lower-case-table-names=1
@item @item
Fixed shutdown problem (SIGTERM signal handling) on Solaris. (Bug from 4.0.2). Fixed shutdown problem (SIGTERM signal handling) on Solaris. (Bug from 4.0.2).
@item @item
...@@ -269,7 +269,7 @@ int handle_options(int *argc, char ***argv, ...@@ -269,7 +269,7 @@ int handle_options(int *argc, char ***argv,
return EXIT_AMBIGUOUS_OPTION; return EXIT_AMBIGUOUS_OPTION;
} }
} }
if (must_be_var && (!optp->value || optp->var_type == GET_BOOL)) if (must_be_var && !optp->value)
{ {
if (my_getopt_print_errors) if (my_getopt_print_errors)
fprintf(stderr, "%s: option '%s' cannot take an argument\n", fprintf(stderr, "%s: option '%s' cannot take an argument\n",
...@@ -278,7 +278,7 @@ int handle_options(int *argc, char ***argv, ...@@ -278,7 +278,7 @@ int handle_options(int *argc, char ***argv,
} }
if (optp->arg_type == NO_ARG) if (optp->arg_type == NO_ARG)
{ {
if (optend && !special_used) if (optend && special_used)
{ {
if (my_getopt_print_errors) if (my_getopt_print_errors)
fprintf(stderr, "%s: option '--%s' cannot take an argument\n", fprintf(stderr, "%s: option '--%s' cannot take an argument\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment