On 04. jan. 2014 14:42, Giuseppe Scrivano wrote:
Hi Håkon,

thanks for your contribution, I have a few comments:

Håkon Vågsether <[email protected]> writes:


 From dd9370f6362650a1f1a2b38577a87776da020547 Mon Sep 17 00:00:00 2001
From: H�kon V�gsether <[email protected]>
Date: Sun, 29 Dec 2013 13:27:18 +0100
Subject: [PATCH] Fixed bug #40908
please use a description of the fix itself in the subject, you can link
to the bug in the commit body though (and that is welcome).

diff --git a/src/http.c b/src/http.c
index 754b7ec..e5dcd3c 100644
--- a/src/http.c
+++ b/src/http.c
@@ -3043,7 +3043,10 @@ http_loop (struct url *u, struct url *original_url, char 
**newloc,
/* Send preliminary HEAD request if -N is given and we have an existing
     * destination file. */
-  file_name = url_file_name (opt.trustservernames ? u : original_url, NULL);
+  if (!opt.output_document)
+    file_name = url_file_name (opt.trustservernames ? u : original_url, NULL);
+  else
+    file_name = opt.output_document;
`file_name' is freed a few lines below, so to ensure you are not freeing
`opt.output_document', you should use:

+    file_name = xstrdup (opt.output_document);

Cheers,
Giuseppe
Hi

Oh, yes of course!

Should be fixed now. :)

Sincerely,
Håkon
>From 33bad86c94b4e25817faa8ea3bf17bfeb9aea4a1 Mon Sep 17 00:00:00 2001
From: HÃ¥kon VÃ¥gsether <[email protected]>
Date: Sun, 5 Jan 2014 00:19:14 +0100
Subject: Fix checking the URL length when filename is specified

---
 src/ChangeLog | 5 +++++
 src/http.c    | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 3d6699c..6c21537 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2014-01-05  HÃ¥kon VÃ¥gsether <[email protected]>
+
+	* http.c (http_loop): Fix checking the URL length when filename is
+	specified.
+
 2013-12-29  Giuseppe Scrivano  <[email protected]>
 
 	* init.c (home_dir): Remove useless 'if'.
diff --git a/src/http.c b/src/http.c
index 754b7ec..2958b74 100644
--- a/src/http.c
+++ b/src/http.c
@@ -3043,7 +3043,10 @@ http_loop (struct url *u, struct url *original_url, char **newloc,
 
   /* Send preliminary HEAD request if -N is given and we have an existing
    * destination file. */
-  file_name = url_file_name (opt.trustservernames ? u : original_url, NULL);
+  if (!opt.output_document)
+      file_name = url_file_name (opt.trustservernames ? u : original_url, NULL);
+  else
+    file_name = xstrdup (opt.output_document);
   if (opt.timestamping && (file_exists_p (file_name)
                            || opt.content_disposition))
     send_head_first = true;
-- 
1.8.5.2

Reply via email to