]> sjero.net Git - wget/commitdiff
Fix checking the URL length when filename is specified
authorHåkon Vågsether <hauk142@gmail.com>
Sat, 4 Jan 2014 23:19:14 +0000 (00:19 +0100)
committerGiuseppe Scrivano <gscrivan@redhat.com>
Tue, 7 Jan 2014 14:59:29 +0000 (15:59 +0100)
src/ChangeLog
src/http.c

index 3d6699cb1c1c8ff9918fd32184692700aa499f0d..0ac1ac61f98c52b031fa3a83d95f47f2558d1a59 100644 (file)
@@ -1,3 +1,8 @@
+2014-01-05  Håkon Vågsether <hauk142@gmail.com> (tiny change)
+
+       * http.c (http_loop): Fix checking the URL length when filename is
+       specified.
+
 2013-12-29  Giuseppe Scrivano  <gscrivan@redhat.com>
 
        * init.c (home_dir): Remove useless 'if'.
index 754b7eca07a52f5dca0a9d4faf2d3a21d5353497..5715df655c54cc8b256c842eaed31d4158a730b4 100644 (file)
@@ -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;