fix for a bug with my_print_defaults with --defaults-extra-file= option

parent 0ad02a92
...@@ -120,25 +120,33 @@ int main(int argc, char **argv) ...@@ -120,25 +120,33 @@ int main(int argc, char **argv)
int count, error; int count, error;
char **load_default_groups, *tmp_arguments[2], char **load_default_groups, *tmp_arguments[2],
**argument, **arguments; **argument, **arguments;
char *defaults, *extra_defaults;
MY_INIT(argv[0]); MY_INIT(argv[0]);
get_defaults_files(argc, argv, &defaults, &extra_defaults);
/* /*
** Check out the args ** Check out the args
*/ */
if (get_options(&argc,&argv))
exit(1);
if (!(load_default_groups=(char**) my_malloc((argc+2)*sizeof(char*), if (!(load_default_groups=(char**) my_malloc((argc+2)*sizeof(char*),
MYF(MY_WME)))) MYF(MY_WME))))
exit(1); exit(1);
if (get_options(&argc,&argv))
exit(1);
for (count=0; *argv ; argv++,count++) for (count=0; *argv ; argv++,count++)
load_default_groups[count]= *argv; load_default_groups[count]= *argv;
load_default_groups[count]=0; load_default_groups[count]=0;
count=1; count=0;
arguments=tmp_arguments; arguments=tmp_arguments;
arguments[0]=my_progname; arguments[count++]=my_progname;
arguments[1]=0; if (extra_defaults)
arguments[count++]= extra_defaults;
if (defaults)
arguments[count++]= defaults;
arguments[count]= 0;
if ((error= load_defaults(config_file, (const char **) load_default_groups, if ((error= load_defaults(config_file, (const char **) load_default_groups,
&count, &arguments))) &count, &arguments)))
{ {
......
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