1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Fix -p so it doesn't imply FTP recursion.

This commit is contained in:
hniksic 2003-10-30 05:00:29 -08:00
parent 6369bc5944
commit 29e36b051b
3 changed files with 19 additions and 6 deletions

View File

@ -1,3 +1,11 @@
2003-10-30 Hrvoje Niksic <hniksic@xemacs.org>
* retr.c (retrieve_from_file): Use retrieve_tree for
page-requisites.
* main.c (main): Don't define opt.recursive when -p is used.
Instead, make sure that recursion is used for HTTP in that case.
2003-10-29 Hrvoje Niksic <hniksic@xemacs.org> 2003-10-29 Hrvoje Niksic <hniksic@xemacs.org>
* host.h: Defined accessors for elements of ip_address. Updated * host.h: Defined accessors for elements of ip_address. Updated

View File

@ -759,10 +759,12 @@ GNU General Public License for more details.\n"));
if (opt.page_requisites && !opt.recursive) if (opt.page_requisites && !opt.recursive)
{ {
opt.recursive = TRUE; /* Don't set opt.recursive here because it would confuse the FTP
code. Instead, call retrieve_tree below when either
page_requisites or recursive is requested. */
opt.reclevel = 0; opt.reclevel = 0;
if (!opt.no_dirstruct) if (!opt.no_dirstruct)
opt.dirstruct = TRUE; /* usually handled by cmd_spec_recursive() */ opt.dirstruct = 1; /* normally handled by cmd_spec_recursive() */
} }
if (opt.verbose == -1) if (opt.verbose == -1)
@ -879,7 +881,8 @@ Can't timestamp and not clobber old files at the same time.\n"));
char *filename = NULL, *redirected_URL = NULL; char *filename = NULL, *redirected_URL = NULL;
int dt; int dt;
if (opt.recursive && url_scheme (*t) != SCHEME_FTP) if ((opt.recursive || opt.page_requisites)
&& url_scheme (*t) != SCHEME_FTP)
status = retrieve_tree (*t); status = retrieve_tree (*t);
else else
status = retrieve_url (*t, &filename, &redirected_URL, NULL, &dt); status = retrieve_url (*t, &filename, &redirected_URL, NULL, &dt);
@ -906,7 +909,7 @@ Can't timestamp and not clobber old files at the same time.\n"));
opt.input_filename); opt.input_filename);
} }
/* Print the downloaded sum. */ /* Print the downloaded sum. */
if (opt.recursive if (opt.recursive || opt.page_requisites
|| nurl > 1 || nurl > 1
|| (opt.input_filename && total_downloaded_bytes != 0)) || (opt.input_filename && total_downloaded_bytes != 0))
{ {

View File

@ -559,7 +559,8 @@ retrieve_url (const char *origurl, char **file, char **newloc,
them. If HTML is non-zero, treat the file as HTML, and construct them. If HTML is non-zero, treat the file as HTML, and construct
the URLs accordingly. the URLs accordingly.
If opt.recursive is set, call recursive_retrieve() for each file. */ If opt.recursive is set, call retrieve_tree() for each file. */
uerr_t uerr_t
retrieve_from_file (const char *file, int html, int *count) retrieve_from_file (const char *file, int html, int *count)
{ {
@ -584,7 +585,8 @@ retrieve_from_file (const char *file, int html, int *count)
status = QUOTEXC; status = QUOTEXC;
break; break;
} }
if (opt.recursive && cur_url->url->scheme != SCHEME_FTP) if ((opt.recursive || opt.page_requisites)
&& cur_url->url->scheme != SCHEME_FTP)
status = retrieve_tree (cur_url->url->url); status = retrieve_tree (cur_url->url->url);
else else
status = retrieve_url (cur_url->url->url, &filename, &new_file, NULL, &dt); status = retrieve_url (cur_url->url->url, &filename, &new_file, NULL, &dt);