diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-06-18 13:58:54 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-06-18 13:58:54 +0300 |
commit | c515b1d092c62f346e512b91e5e68311892fe128 (patch) | |
tree | 6cec2ad22507d67c865026c8f68c6aeb774459f1 /mysys | |
parent | baff3ba6e32d68876ec91fe808de8872088a393b (diff) | |
parent | 205b0ce6ad21dbafe8def505307b4922398db5b2 (diff) | |
download | mariadb-git-c515b1d092c62f346e512b91e5e68311892fe128.tar.gz |
Merge 10.4 into 10.5
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/my_getopt.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index 5576c8b5d5d..9747ee4214e 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -1,6 +1,6 @@ /* Copyright (c) 2002, 2013, Oracle and/or its affiliates - Copyright (c) 2009, 2015, MariaDB + Copyright (c) 2009, 2020, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -79,6 +79,12 @@ my_bool my_getopt_skip_unknown= 0; */ my_bool my_getopt_prefix_matching= 1; +/* + This is a flag that can be set in client programs. 1 means that + handle_options() will not initialize options to default values. +*/ +my_bool my_handle_options_init_variables = 1; + my_getopt_value my_getopt_get_addr= 0; static void default_reporter(enum loglevel level, const char *format, ...) @@ -205,7 +211,8 @@ int handle_options(int *argc, char ***argv, const struct my_option *longopts, DBUG_ASSERT(*argv); (*argc)--; /* Skip the program name */ (*argv)++; /* --- || ---- */ - init_variables(longopts, init_one_value); + if (my_handle_options_init_variables) + init_variables(longopts, init_one_value); is_cmdline_arg= !is_file_marker(**argv); |