summaryrefslogtreecommitdiff
path: root/mysys/my_getopt.c
diff options
context:
space:
mode:
authorunknown <jani@hynda.(none)>2002-08-19 16:27:59 +0300
committerunknown <jani@hynda.(none)>2002-08-19 16:27:59 +0300
commit338b68acf6a049c6950b7d2e697c04bf5c6a74bf (patch)
tree96a3c269db9013fddb63bb77509369c7225341c6 /mysys/my_getopt.c
parent457172d99256e68a93ab69eecbef23a3db7ef1c4 (diff)
downloadmariadb-git-338b68acf6a049c6950b7d2e697c04bf5c6a74bf.tar.gz
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
Diffstat (limited to 'mysys/my_getopt.c')
-rw-r--r--mysys/my_getopt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index 436e557c914..5b86fddbbdb 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -269,7 +269,7 @@ int handle_options(int *argc, char ***argv,
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)
fprintf(stderr, "%s: option '%s' cannot take an argument\n",
@@ -278,7 +278,7 @@ int handle_options(int *argc, char ***argv,
}
if (optp->arg_type == NO_ARG)
{
- if (optend && !special_used)
+ if (optend && special_used)
{
if (my_getopt_print_errors)
fprintf(stderr, "%s: option '--%s' cannot take an argument\n",