diff --git a/src/ChangeLog b/src/ChangeLog index 0863de3a..28070a19 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2003-10-30 Hrvoje Niksic + + * 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 * host.h: Defined accessors for elements of ip_address. Updated diff --git a/src/main.c b/src/main.c index bec8561d..4c12fc00 100644 --- a/src/main.c +++ b/src/main.c @@ -759,10 +759,12 @@ GNU General Public License for more details.\n")); 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; 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) @@ -879,7 +881,8 @@ Can't timestamp and not clobber old files at the same time.\n")); char *filename = NULL, *redirected_URL = NULL; 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); else 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); } /* Print the downloaded sum. */ - if (opt.recursive + if (opt.recursive || opt.page_requisites || nurl > 1 || (opt.input_filename && total_downloaded_bytes != 0)) { diff --git a/src/retr.c b/src/retr.c index 35286111..eb1f9553 100644 --- a/src/retr.c +++ b/src/retr.c @@ -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 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 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; 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); else status = retrieve_url (cur_url->url->url, &filename, &new_file, NULL, &dt);