From 65af6f743205165d549c028b8eab0d0b631f56e5 Mon Sep 17 00:00:00 2001 From: mtortonesi Date: Thu, 18 Nov 2004 16:44:38 -0800 Subject: [PATCH] [svn] Fixed -k when using -O. --- src/ChangeLog | 5 +++++ src/http.c | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 2fc91b81..c0d3258f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-11-18 Hans-Andreas Engel + + * http.c: Enable --convert-links (-k) when a single page is downloaded + via --output-document (-O). + 2004-11-18 Mauro Tortonesi * connect.c: Minor correction to the comment in front of fd_peek. diff --git a/src/http.c b/src/http.c index 0f19cbb7..07c3c417 100644 --- a/src/http.c +++ b/src/http.c @@ -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);