X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Finit.c;h=ffdaa6d6a93c65fc1f7af6beb05b81287ab940fd;hp=e752205d9caeb6002d9489b3f7c6a0cfb6a4a317;hb=8c7afaf3bb737e50bf289c2a2d60128425d1426b;hpb=b12160ea024580b3c9dea30aeb9e0c404ef2ac3f diff --git a/src/init.c b/src/init.c index e752205d..ffdaa6d6 100644 --- a/src/init.c +++ b/src/init.c @@ -32,6 +32,7 @@ as that of the covered work. */ #include #include +#include #ifdef HAVE_UNISTD_H # include #endif @@ -136,6 +137,7 @@ static const struct { { "certificatetype", &opt.cert_type, cmd_cert_type }, { "checkcertificate", &opt.check_cert, cmd_boolean }, #endif + { "chooseconfig", &opt.choose_config, cmd_file }, { "connecttimeout", &opt.connect_timeout, cmd_time }, { "contentdisposition", &opt.content_disposition, cmd_boolean }, { "continue", &opt.always_rest, cmd_boolean }, @@ -291,7 +293,7 @@ command_by_name (const char *cmdname) } /* Reset the variables to default values. */ -static void +void defaults (void) { char *tmp; @@ -510,7 +512,7 @@ static bool setval_internal_tilde (int, const char *, const char *); /* Initialize variables from a wgetrc file. Returns zero (failure) if there were errors in the file. */ -static bool +bool run_wgetrc (const char *file) { FILE *fp; @@ -574,10 +576,7 @@ void initialize (void) { char *file, *env_sysrc; - int ok = true; - - /* Load the hard-coded defaults. */ - defaults (); + bool ok = true; /* Run a non-standard system rc file when the according environment variable has been set. For internal testing purposes only! */ @@ -1578,6 +1577,7 @@ cleanup (void) extern acc_t *netrc_list; free_netrc (netrc_list); } + xfree_null (opt.choose_config); xfree_null (opt.lfilename); xfree_null (opt.dir_prefix); xfree_null (opt.input_filename);