mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Do not honor --config only when used as first long argument
This commit is contained in:
parent
dcf667fb57
commit
b56a528aea
@ -1,5 +1,9 @@
|
|||||||
2012-12-09 Giuseppe Scrivano <gscrivano@gnu.org>
|
2012-12-09 Giuseppe Scrivano <gscrivano@gnu.org>
|
||||||
|
|
||||||
|
* main.c (main): Keep looking for "config" until there are
|
||||||
|
arguments to parse.
|
||||||
|
Reported by: Adrien Dumont <adr.dum@hotmail.fr>
|
||||||
|
|
||||||
* test.c: Include "wget.h".
|
* test.c: Include "wget.h".
|
||||||
|
|
||||||
2012-12-08 Michael Stapelberg <michael@stapelberg.de> (tiny change)
|
2012-12-08 Michael Stapelberg <michael@stapelberg.de> (tiny change)
|
||||||
|
16
src/main.c
16
src/main.c
@ -1034,7 +1034,6 @@ main (int argc, char **argv)
|
|||||||
short_options, long_options, &longindex)) != -1)
|
short_options, long_options, &longindex)) != -1)
|
||||||
{
|
{
|
||||||
int confval;
|
int confval;
|
||||||
bool userrc_ret = true;
|
|
||||||
struct cmdline_option *config_opt;
|
struct cmdline_option *config_opt;
|
||||||
|
|
||||||
/* There is no short option for "--config". */
|
/* There is no short option for "--config". */
|
||||||
@ -1044,16 +1043,17 @@ main (int argc, char **argv)
|
|||||||
config_opt = &option_data[confval & ~BOOLEAN_NEG_MARKER];
|
config_opt = &option_data[confval & ~BOOLEAN_NEG_MARKER];
|
||||||
if (strcmp (config_opt->long_name, "config") == 0)
|
if (strcmp (config_opt->long_name, "config") == 0)
|
||||||
{
|
{
|
||||||
|
bool userrc_ret = true;
|
||||||
userrc_ret &= run_wgetrc (optarg);
|
userrc_ret &= run_wgetrc (optarg);
|
||||||
use_userconfig = true;
|
use_userconfig = true;
|
||||||
|
if (userrc_ret)
|
||||||
|
break;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fprintf (stderr, _("Exiting due to error in %s\n"), optarg);
|
||||||
|
exit (2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!userrc_ret)
|
|
||||||
{
|
|
||||||
fprintf (stderr, _("Exiting due to error in %s\n"), optarg);
|
|
||||||
exit (2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user