]> sjero.net Git - wget/commitdiff
Automated merge.
authorSaint Xavier <wget@sxav.eu>
Wed, 23 Jul 2008 22:58:10 +0000 (00:58 +0200)
committerSaint Xavier <wget@sxav.eu>
Wed, 23 Jul 2008 22:58:10 +0000 (00:58 +0200)
doc/ChangeLog
doc/wget.texi
src/ChangeLog
src/init.c
src/retr.c

index 94d724438506e74994eaeb67b83bd008e9361466..4f68780e3c11bd755d0611221811388a85117fc4 100644 (file)
@@ -1,3 +1,10 @@
+2008-07-17  Steven Schubiger  <stsc@members.fsf.org>
+
+       * wget.texi (Logging and Input File Options): Document
+       for --input-file and according remote input file URLs, the
+       implicit enforcement of treating a document as HTML and
+       the possible baseref assumption.
+
 2008-06-29  Micah Cowan  <micah@cowan.name>
 
        * wget.texi <Contributors>: Added Joao Ferreira, Mike Frysinger,
index 50ee459e95c33fc3709566167d6ad7b04c9dc159..6f88e19a93d4ed5d37a04c5b496dbae33bbf6bae 100644 (file)
@@ -497,6 +497,11 @@ relative links, which you can solve either by adding @code{<base
 href="@var{url}">} to the documents or by specifying
 @samp{--base=@var{url}} on the command line.
 
+If the @var{file} is an external one, the document will be automatically
+treated as @samp{html} if the Content-Type matches @samp{text/html}.
+Furthermore, the @var{file}'s location will be implicitly used as base
+href if none was specified.
+
 @cindex force html
 @item -F
 @itemx --force-html
index 02bc331b8e4a712f29cebce774b0df63a080ff0f..fd86c51caf62ce6a9dfd86e9ef3cb2fe27a860c6 100644 (file)
@@ -1,3 +1,12 @@
+2008-07-17  Steven Schubiger  <stsc@members.fsf.org>
+
+       * retr.c (retrieve_from_file): When given an URL as input file,
+       use it as baseref if none was specified and treat the input file
+       as HTML if its content type is text/html.
+
+       * init.c (cleanup): Free the memory associated with the base
+       option (when DEBUG_MALLOC is defined).
+
 2008-07-02  Xavier Saint  <wget@sxav.eu>
 
        * iri.c, iri.h  : New function idn_decode() to decode ASCII
index f56aa65282c94f46a7469eb92cce3a504f9197ad..d01a1c80f9ccf35985424cc8cd16e19865a3ef2f 100644 (file)
@@ -1559,6 +1559,8 @@ cleanup (void)
   xfree_null (opt.cookies_output);
   xfree_null (opt.user);
   xfree_null (opt.passwd);
+  xfree_null (opt.base_href);
+  
 #endif /* DEBUG_MALLOC */
 }
 \f
index e70f6e6e5433e02a88d1024e270e9347bbcad909..ae8ef3ef1f772366efd446311cccf446b2168a64 100644 (file)
@@ -861,10 +861,18 @@ retrieve_from_file (const char *file, bool html, int *count)
 
   if (url_has_scheme (url))
     {
+      int dt;
       uerr_t status;
-      status = retrieve_url (url, &input_file, NULL, NULL, NULL, false, iri);
+
+      if (!opt.base_href)
+        opt.base_href = xstrdup (url);
+
+      status = retrieve_url (url, &input_file, NULL, NULL, &dt, false, iri);
       if (status != RETROK)
         return status;
+
+      if (dt & TEXTHTML)
+        html = true;
     }
   else
     input_file = (char *) file;