summaryrefslogtreecommitdiff
path: root/mysys/my_getopt.c
diff options
context:
space:
mode:
authorHe Zhenxing <hezx@greatopensource.com>2011-01-17 15:44:37 +0800
committerHe Zhenxing <hezx@greatopensource.com>2011-01-17 15:44:37 +0800
commitc5aa3313aa44c13e40875a8e2fae01db26377c59 (patch)
tree37a584099deb64bea3ff4693b872e856a9357eaa /mysys/my_getopt.c
parent8e3dde5e2f993f912bb420df6d1406b6bc7be254 (diff)
downloadmariadb-git-c5aa3313aa44c13e40875a8e2fae01db26377c59.tar.gz
BUG#57953 my_load_defaults return junk argument ----args-separator---- to caller
After fix of bug#25192, load_defaults() will add an args separator to distinguish options loaded from configure files from that provided in the command line. One problem of this is that the args separator would be added no matter the application need it or not. Fixed the problem by adding an option: bool my_getopt_use_args_separator; to control whether the separator will be added or not. And also added functions: bool my_getopt_is_args_separator(const char* arg); to check if the argument is the separator or not.
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 efa7e0bb1b3..6f7ed070ccf 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -176,7 +176,7 @@ int handle_options(int *argc, char ***argv,
*/
for (pos= *argv, pos_end=pos+ *argc; pos != pos_end ; pos++)
{
- if (*pos == args_separator)
+ if (my_getopt_is_args_separator(*pos))
{
is_cmdline_arg= 0;
break;
@@ -188,7 +188,7 @@ int handle_options(int *argc, char ***argv,
char **first= pos;
char *cur_arg= *pos;
opt_found= 0;
- if (!is_cmdline_arg && (cur_arg == args_separator))
+ if (!is_cmdline_arg && (my_getopt_is_args_separator(cur_arg)))
{
is_cmdline_arg= 1;