From: Saint Xavier Date: Wed, 23 Jul 2008 22:58:10 +0000 (+0200) Subject: Automated merge. X-Git-Tag: v1.13~338^2~7^2~6^2~13 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=ccd62071dcbdfc0269813746b9f51ff9c23261db;hp=d82f80ecab9bfef857d780f894cca7e890780ce0 Automated merge. --- diff --git a/doc/ChangeLog b/doc/ChangeLog index 94d72443..4f68780e 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,10 @@ +2008-07-17 Steven Schubiger + + * 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 * wget.texi : Added Joao Ferreira, Mike Frysinger, diff --git a/doc/wget.texi b/doc/wget.texi index 50ee459e..6f88e19a 100644 --- a/doc/wget.texi +++ b/doc/wget.texi @@ -497,6 +497,11 @@ relative links, which you can solve either by adding @code{} 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 diff --git a/src/ChangeLog b/src/ChangeLog index 02bc331b..fd86c51c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2008-07-17 Steven Schubiger + + * 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 * iri.c, iri.h : New function idn_decode() to decode ASCII diff --git a/src/init.c b/src/init.c index f56aa652..d01a1c80 100644 --- a/src/init.c +++ b/src/init.c @@ -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 */ } diff --git a/src/retr.c b/src/retr.c index e70f6e6e..ae8ef3ef 100644 --- a/src/retr.c +++ b/src/retr.c @@ -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;