]> sjero.net Git - wget/commitdiff
[svn] Fixed -k when using -O.
authormtortonesi <devnull@localhost>
Fri, 19 Nov 2004 00:44:38 +0000 (16:44 -0800)
committermtortonesi <devnull@localhost>
Fri, 19 Nov 2004 00:44:38 +0000 (16:44 -0800)
src/ChangeLog
src/http.c

index 2fc91b81c02c86bbebfd9c191d629b3086fc2834..c0d3258fded5582fcb2c24082790830d7db13841 100644 (file)
@@ -1,3 +1,8 @@
+2004-11-18  Hans-Andreas Engel <engel@node.ch>
+
+       * http.c: Enable --convert-links (-k) when a single page is downloaded
+       via --output-document (-O).
+
 2004-11-18  Mauro Tortonesi <mauro@deepspace6.net>
 
        * connect.c: Minor correction to the comment in front of fd_peek.
index 0f19cbb778a310d738b4708c0ffee936b123aa87..07c3c4171a80a4646e6e7e6fa9416671f5746be4 100644 (file)
@@ -1801,7 +1801,7 @@ http_loop (struct url *u, char **newloc, char **local_file, const char *referer,
   /* Determine the local filename.  */
   if (local_file && *local_file)
     hstat.local_file = local_file;
-  else if (local_file)
+  else if (local_file && !opt.output_document)
     {
       *local_file = url_file_name (u);
       hstat.local_file = local_file;
@@ -1810,6 +1810,9 @@ http_loop (struct url *u, char **newloc, char **local_file, const char *referer,
     {
       dummy = url_file_name (u);
       hstat.local_file = &dummy;
+      /* be honest about where we will save the file */
+      if (local_file && opt.output_document)
+        *local_file = HYPHENP (opt.output_document) ? NULL : xstrdup (opt.output_document);
     }
 
   if (!opt.output_document)
@@ -1962,8 +1965,6 @@ File `%s' already there, will not retrieve.\n"), *hstat.local_file);
         *hstat.local_file to tack on ".html". */
       if (!opt.output_document)
        locf = *hstat.local_file;
-      else
-       locf = opt.output_document;
 
       /* Time?  */
       tms = time_str (NULL);