diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..acb26693 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "gnulib"] + path = gnulib + url = git://git.sv.gnu.org/gnulib.git diff --git a/ChangeLog b/ChangeLog index 0c89fee2..d57ad03f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-12-22 Giuseppe Scrivano + + * gnulib: add git submodule. + 2013-10-23 Darshit Shah * configure.ac: Add --race-detection. diff --git a/NEWS b/NEWS index 5605e1b3..1de425dd 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,10 @@ Please send GNU Wget bug reports to . * Changes in Wget X.Y.Z +** Introduce --no-config. + +* Changes in Wget 1.15 + ** Add support for --method. ** Add support for file names longer than MAX_FILE. @@ -35,6 +39,8 @@ Please send GNU Wget bug reports to . ** Support some FTP servers that return an empty list with "LIST -a". ** Specify Host with the HTTP CONNECT method. + +** Use the correct HTTP method on a redirection. * Changes in Wget 1.14 diff --git a/doc/ChangeLog b/doc/ChangeLog index aa99d6ce..41e34345 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,11 @@ +2013-12-29 Giuseppe Scrivano + + * wget.texi: Update to GFDL 1.3. + +2013-12-22 Mike Frysinger + + * sample.wgetrc: add links to the manual. + 2013-10-06 Tim Ruehsen * wget.texi: add/explain quoting of wildcard patterns diff --git a/doc/sample.wgetrc b/doc/sample.wgetrc index eaf2bc81..ad86be32 100644 --- a/doc/sample.wgetrc +++ b/doc/sample.wgetrc @@ -5,7 +5,10 @@ ## You can use this file to change the default behaviour of wget or to ## avoid having to type many many command-line options. This file does ## not contain a comprehensive list of commands -- look at the manual -## to find out what you can put into this file. +## to find out what you can put into this file. You can find this here: +## $ info wget.info 'Startup File' +## Or online here: +## https://www.gnu.org/software/wget/manual/wget.html#Startup-File ## ## Wget initialization file can reside in /usr/local/etc/wgetrc ## (global, for all users) or $HOME/.wgetrc (for a single user). diff --git a/doc/wget.texi b/doc/wget.texi index 893bc8c3..0b842549 100644 --- a/doc/wget.texi +++ b/doc/wget.texi @@ -47,11 +47,11 @@ notice identical to this one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). @end ignore Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 or +under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no -Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A -copy of the license is included in the section entitled ``GNU Free -Documentation License''. +Invariant Sections, with no Front-Cover Texts, and with no Back-Cover +Texts. A copy of the license is included in the section entitled +``GNU Free Documentation License''. @c man end @end copying @@ -4419,7 +4419,7 @@ subscribers of the Wget mailing list. @appendix Copying this manual @menu -* GNU Free Documentation License:: Licnse for copying this manual. +* GNU Free Documentation License:: License for copying this manual. @end menu @node GNU Free Documentation License, , Copying this manual, Copying this manual diff --git a/gnulib b/gnulib new file mode 160000 index 00000000..0ac90c5a --- /dev/null +++ b/gnulib @@ -0,0 +1 @@ +Subproject commit 0ac90c5a98030c998f3e1db3a0d7f19d4630b6b6 diff --git a/src/ChangeLog b/src/ChangeLog index fe4c3219..b1397758 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,27 @@ +2014-01-17 Darshit Shah + + * init.c (commands[]): Add --no-config. + * options.h: Same. + * main.c (option_data[]): Same. + (print_help): Same. + (main): If --no-config is set, then do not read the wgetrc files. + +2014-01-05 Håkon Vågsether (tiny change) + + * http.c (http_loop): Fix checking the URL length when filename is + specified. + +2013-12-29 Giuseppe Scrivano + + * init.c (home_dir): Remove useless 'if'. + * warc.c (warc_start_new_file): Likewise. + (warc_process_cdx_line): Likewise. + (warc_write_response_record): Likewise. + +2013-12-26 Tim Ruehsen + + * gnutls.c (ssl_connect_wget): Fix connect timeout failure + 2013-11-10 Giuseppe Scrivano * options.h (struct options) [!ENABLE_THREADS]: Define jobs. diff --git a/src/gnutls.c b/src/gnutls.c index 9b4b1ec0..4f0fa962 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -526,8 +526,7 @@ ssl_connect_wget (int fd, const char *hostname) break; } - if (err <= 0) - break; + err = GNUTLS_E_AGAIN; } else if (err < 0) { @@ -543,7 +542,7 @@ ssl_connect_wget (int fd, const char *hostname) } } } - while (err == GNUTLS_E_WARNING_ALERT_RECEIVED && gnutls_error_is_fatal (err) == 0); + while (err && gnutls_error_is_fatal (err) == 0); if (opt.connect_timeout) { diff --git a/src/http.c b/src/http.c index 1141fb25..a09210f5 100644 --- a/src/http.c +++ b/src/http.c @@ -3344,7 +3344,10 @@ http_loop (struct url *u, struct url *original_url, char **newloc, /* Send preliminary HEAD request if -N is given and we have an existing * destination file. */ - file_name = url_file_name (opt.trustservernames ? u : original_url, NULL); + if (!opt.output_document) + file_name = url_file_name (opt.trustservernames ? u : original_url, NULL); + else + file_name = xstrdup (opt.output_document); if (opt.timestamping && (file_exists_p (file_name) || opt.content_disposition)) send_head_first = true; diff --git a/src/init.c b/src/init.c index 17a935ae..9199eb6a 100644 --- a/src/init.c +++ b/src/init.c @@ -160,7 +160,7 @@ static const struct { #ifdef ENABLE_DEBUG { "debug", &opt.debug, cmd_boolean }, #endif - { "defaultpage", &opt.default_page, cmd_string }, + { "defaultpage", &opt.default_page, cmd_string }, { "deleteafter", &opt.delete_after, cmd_boolean }, { "dirprefix", &opt.dir_prefix, cmd_directory }, { "dirstruct", NULL, cmd_spec_dirstruct }, @@ -226,6 +226,7 @@ static const struct { { "mirror", NULL, cmd_spec_mirror }, { "netrc", &opt.netrc, cmd_boolean }, { "noclobber", &opt.noclobber, cmd_boolean }, + { "noconfig", &opt.noconfig, cmd_boolean }, { "noparent", &opt.no_parent, cmd_boolean }, { "noproxy", &opt.no_proxy, cmd_vector }, { "numtries", &opt.ntry, cmd_number_inf },/* deprecated*/ @@ -477,8 +478,7 @@ home_dir (void) } ret = home ? xstrdup (home) : NULL; - if (buf) - free (buf); + free (buf); return ret; } diff --git a/src/main.c b/src/main.c index 8daedf43..58a00f33 100644 --- a/src/main.c +++ b/src/main.c @@ -244,6 +244,7 @@ static struct cmdline_option option_data[] = { "mirror", 'm', OPT_BOOLEAN, "mirror", -1 }, { "no", 'n', OPT__NO, NULL, required_argument }, { "no-clobber", 0, OPT_BOOLEAN, "noclobber", -1 }, + { "no-config", 0, OPT_BOOLEAN, "noconfig", -1}, { "no-parent", 0, OPT_BOOLEAN, "noparent", -1 }, { "output-document", 'O', OPT_VALUE, "outputdocument", -1 }, { "output-file", 'o', OPT_VALUE, "logfile", -1 }, @@ -483,11 +484,14 @@ Logging and input file:\n"), relative to URL.\n"), N_("\ --config=FILE Specify config file to use.\n"), + N_("\ + --no-config Do not read any config file.\n"), + "\n", + #ifdef ENABLE_METALINK N_("\ --metalink-file download URLs found in local or external metalink FILE.\n"), #endif - "\n", N_("\ Download:\n"), @@ -1066,6 +1070,7 @@ main (int argc, char **argv) longindex = -1; int retconf; bool use_userconfig = false; + bool noconfig = false; while ((retconf = getopt_long (argc, argv, short_options, long_options, &longindex)) != -1) @@ -1078,7 +1083,12 @@ main (int argc, char **argv) { confval = long_options[longindex].val; config_opt = &option_data[confval & ~BOOLEAN_NEG_MARKER]; - if (strcmp (config_opt->long_name, "config") == 0) + if (strcmp (config_opt->long_name, "no-config") == 0) + { + noconfig = true; + break; + } + else if (strcmp (config_opt->long_name, "config") == 0) { bool userrc_ret = true; userrc_ret &= run_wgetrc (optarg); @@ -1095,7 +1105,7 @@ main (int argc, char **argv) } /* If the user did not specify a config, read the system wgetrc and ~/.wgetrc. */ - if (use_userconfig == false) + if (noconfig == false && use_userconfig == false) initialize (); opterr = 0; diff --git a/src/options.h b/src/options.h index 75eb8fa0..145993f1 100644 --- a/src/options.h +++ b/src/options.h @@ -65,6 +65,7 @@ struct options char *lfilename; /* Log filename */ char *input_filename; /* Input filename */ char *choose_config; /* Specified config file */ + bool noconfig; bool force_html; /* Is the input file an HTML file? */ char *default_page; /* Alternative default page (index file) */ diff --git a/src/warc.c b/src/warc.c index 41f522af..c3a58572 100644 --- a/src/warc.c +++ b/src/warc.c @@ -726,10 +726,9 @@ warc_start_new_file (bool meta) if (warc_current_file != NULL) fclose (warc_current_file); - if (warc_current_warcinfo_uuid_str) - free (warc_current_warcinfo_uuid_str); - if (warc_current_filename) - free (warc_current_filename); + + free (warc_current_warcinfo_uuid_str); + free (warc_current_filename); warc_current_file_number++; @@ -918,8 +917,7 @@ warc_process_cdx_line (char *lineptr, int field_num_original_url, else { free (original_url); - if (checksum_v != NULL) - free (checksum_v); + free (checksum_v); free (record_id); } } @@ -1417,10 +1415,8 @@ warc_write_response_record (char *url, char *timestamp_str, response_uuid); } - if (block_digest) - free (block_digest); - if (payload_digest) - free (payload_digest); + free (block_digest); + free (payload_digest); return warc_write_ok; }