]> sjero.net Git - wget/commitdiff
[svn] Fix -p so it doesn't imply FTP recursion.
authorhniksic <devnull@localhost>
Thu, 30 Oct 2003 13:00:29 +0000 (05:00 -0800)
committerhniksic <devnull@localhost>
Thu, 30 Oct 2003 13:00:29 +0000 (05:00 -0800)
src/ChangeLog
src/main.c
src/retr.c

index 0863de3afd4544eb361e1998cc47ec667eea7411..28070a19d2d9ba0df565890f86d6395288d35a0b 100644 (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>
 
        * host.h: Defined accessors for elements of ip_address.  Updated
index bec8561d0d416ab5cd5f9ad90cc92d6bf97d827c..4c12fc0083c22bdc61bc0fe01bd04cc9a134b223 100644 (file)
@@ -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))
     {
index 35286111e2020cd2bb7d5ff330425c5dadf2a150..eb1f9553cf58c56e9bbe5ccfa5baf098e4f4fb94 100644 (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
    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);