]> sjero.net Git - wget/commitdiff
[svn] Don't pattern-match server redirects.
authorhniksic <devnull@localhost>
Sat, 25 Jun 2005 15:04:47 +0000 (08:04 -0700)
committerhniksic <devnull@localhost>
Sat, 25 Jun 2005 15:04:47 +0000 (08:04 -0700)
src/ChangeLog
src/http.c
src/retr.c

index c57476f74e86fd14053310899536489ebefd77d0..d5b9f71b021c40807a5b72dd7a8e841367ee2655 100644 (file)
@@ -1,3 +1,11 @@
+2005-06-25  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * http.c (http_loop): Don't warn about wildcards in HTTP URLs if
+       globbing isn't requested in the first place.
+
+       * retr.c (retrieve_url): Temporarily turn off globbing when
+       processing HTTP->FTP redirects.
+
 2005-06-25  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * utils.c (with_thousand_seps_sum): Now defined only if
index 36a8e9fbf5a195f30c3faf95813d0948142ada26..295475d4c94285ae78b11aa6c4fcf82335d9c3aa 100644 (file)
@@ -1996,7 +1996,7 @@ http_loop (struct url *u, char **newloc, char **local_file, const char *referer,
   *newloc = NULL;
 
   /* Warn on (likely bogus) wildcard usage in HTTP.  */
-  if (has_wildcards_p (u->path))
+  if (opt.ftp_glob && has_wildcards_p (u->path))
     logputs (LOG_VERBOSE, _("Warning: wildcards not supported in HTTP.\n"));
 
   xzero (hstat);
index 0285a57a90c2b12f503d6e08bb285ccf8e232fe6..6fed26a1e5405bc92918fa34011bfd888389f196 100644 (file)
@@ -660,14 +660,16 @@ retrieve_url (const char *origurl, char **file, char **newloc,
     }
   else if (u->scheme == SCHEME_FTP)
     {
-      /* If this is a redirection, we must not allow recursive FTP
-        retrieval, so we save recursion to oldrec, and restore it
-        later.  */
-      bool oldrec = opt.recursive;
+      /* If this is a redirection, temporarily turn off opt.ftp_glob
+        and opt.recursive, both being undesirable when following
+        redirects.  */
+      bool oldrec = opt.recursive, oldglob = opt.ftp_glob;
       if (redirection_count)
-       opt.recursive = false;
+       opt.recursive = opt.ftp_glob = false;
+
       result = ftp_loop (u, dt, proxy_url);
       opt.recursive = oldrec;
+      opt.ftp_glob = oldglob;
 
       /* There is a possibility of having HTTP being redirected to
         FTP.  In these cases we must decide whether the text is HTML