Commit f7b8d144 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: don't use my_getopt_is_args_separator()

only my_getopt should use it, because it changes my_getopt's behavior.
If one simply wants to skip the separator - don't ask it to be added
in the first place
parent 3e569727
...@@ -198,7 +198,6 @@ int main(int argc, char **argv) ...@@ -198,7 +198,6 @@ int main(int argc, char **argv)
} }
for (argument= arguments+1 ; *argument ; argument++) for (argument= arguments+1 ; *argument ; argument++)
if (!my_getopt_is_args_separator(*argument)) /* skip arguments separator */
puts(*argument); puts(*argument);
my_free(load_default_groups); my_free(load_default_groups);
free_defaults(arguments); free_defaults(arguments);
......
...@@ -24,7 +24,6 @@ extern const char *my_defaults_extra_file; ...@@ -24,7 +24,6 @@ extern const char *my_defaults_extra_file;
extern const char *my_defaults_group_suffix; extern const char *my_defaults_group_suffix;
extern const char *my_defaults_file; extern const char *my_defaults_file;
extern my_bool my_getopt_use_args_separator; extern my_bool my_getopt_use_args_separator;
extern my_bool my_getopt_is_args_separator(const char* arg);
extern int get_defaults_options(char **argv); extern int get_defaults_options(char **argv);
extern int my_load_defaults(const char *conf_file, const char **groups, extern int my_load_defaults(const char *conf_file, const char **groups,
......
...@@ -335,6 +335,7 @@ int get_defaults_options(char **argv) ...@@ -335,6 +335,7 @@ int get_defaults_options(char **argv)
if (*argv && !strcmp(*argv, "--print-defaults")) if (*argv && !strcmp(*argv, "--print-defaults"))
{ {
my_print_defaults= 1; my_print_defaults= 1;
my_getopt_use_args_separator= FALSE;
argv++; argv++;
} }
...@@ -499,7 +500,6 @@ int my_load_defaults(const char *conf_file, const char **groups, int *argc, ...@@ -499,7 +500,6 @@ int my_load_defaults(const char *conf_file, const char **groups, int *argc,
printf("%s would have been started with the following arguments:\n", printf("%s would have been started with the following arguments:\n",
**argv); **argv);
for (i=1 ; i < *argc ; i++) for (i=1 ; i < *argc ; i++)
if (!my_getopt_is_args_separator((*argv)[i])) /* skip arguments separator */
printf("%s ", (*argv)[i]); printf("%s ", (*argv)[i]);
puts(""); puts("");
DBUG_RETURN(4); DBUG_RETURN(4);
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <my_getopt.h> #include <my_getopt.h>
#include <errno.h> #include <errno.h>
my_bool my_getopt_is_args_separator(const char* arg);
typedef void (*init_func_p)(const struct my_option *option, void *variable, typedef void (*init_func_p)(const struct my_option *option, void *variable,
longlong value); longlong value);
......
...@@ -854,8 +854,6 @@ void mysql_read_default_options(struct st_mysql_options *options, ...@@ -854,8 +854,6 @@ void mysql_read_default_options(struct st_mysql_options *options,
char **option=argv; char **option=argv;
while (*++option) while (*++option)
{ {
if (my_getopt_is_args_separator(option[0])) /* skip arguments separator */
continue;
/* DBUG_PRINT("info",("option: %s",option[0])); */ /* DBUG_PRINT("info",("option: %s",option[0])); */
if (option[0][0] == '-' && option[0][1] == '-') if (option[0][0] == '-' && option[0][1] == '-')
{ {
......
...@@ -5350,7 +5350,6 @@ int mysqld_main(int argc, char **argv) ...@@ -5350,7 +5350,6 @@ int mysqld_main(int argc, char **argv)
orig_argv= argv; orig_argv= argv;
my_getopt_use_args_separator= TRUE; my_getopt_use_args_separator= TRUE;
load_defaults_or_exit(MYSQL_CONFIG_NAME, load_default_groups, &argc, &argv); load_defaults_or_exit(MYSQL_CONFIG_NAME, load_default_groups, &argc, &argv);
my_getopt_use_args_separator= FALSE;
defaults_argc= argc; defaults_argc= argc;
defaults_argv= argv; defaults_argv= argv;
remaining_argc= argc; remaining_argc= argc;
......
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