]> sjero.net Git - wget/blobdiff - src/recur.c
Mark some options as deprecated.
[wget] / src / recur.c
index e4ffa4246f3744db34f7576df826250ae2930674..9ca3f941e39ac2802bec74a9cb11d2a44b9aa3ef 100644 (file)
@@ -1,6 +1,6 @@
 /* Handling of recursive HTTP retrieving.
-   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-   2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 This file is part of GNU Wget.
 
@@ -111,7 +111,8 @@ url_enqueue (struct url_queue *queue, struct iri *i,
   if (queue->count > queue->maxcount)
     queue->maxcount = queue->count;
 
-  DEBUGP (("Enqueuing %s at depth %d\n", url, depth));
+  DEBUGP (("Enqueuing %s at depth %d\n",
+           quotearg_n_style (0, escape_quoting_style, url), depth));
   DEBUGP (("Queue count %d, maxcount %d.\n", queue->count, queue->maxcount));
 
   if (i)
@@ -152,7 +153,8 @@ url_dequeue (struct url_queue *queue, struct iri **i,
 
   --queue->count;
 
-  DEBUGP (("Dequeuing %s at depth %d\n", qel->url, qel->depth));
+  DEBUGP (("Dequeuing %s at depth %d\n",
+           quotearg_n_style (0, escape_quoting_style, qel->url), qel->depth));
   DEBUGP (("Queue count %d, maxcount %d.\n", queue->count, queue->maxcount));
 
   xfree (qel);
@@ -281,7 +283,7 @@ retrieve_tree (struct url *start_url_parsed, struct iri *pi)
           struct url *url_parsed = url_parse (url, &url_err, i, true);
 
           status = retrieve_url (url_parsed, url, &file, &redirected, referer,
-                                 &dt, false, i);
+                                 &dt, false, i, true);
 
           if (html_allowed && file && status == RETROK
               && (dt & RETROKF) && (dt & TEXTHTML))
@@ -320,6 +322,11 @@ retrieve_tree (struct url *start_url_parsed, struct iri *pi)
               xfree (url);
               url = redirected;
             }
+          else
+            {
+              xfree (url);
+              url = xstrdup (url_parsed->url);
+            }
           url_free(url_parsed);
         }