diff --git a/src/ChangeLog b/src/ChangeLog index 3d6699cb..0ac1ac61 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-01-05 Håkon Vågsether (tiny change) + + * http.c (http_loop): Fix checking the URL length when filename is + specified. + 2013-12-29 Giuseppe Scrivano * init.c (home_dir): Remove useless 'if'. diff --git a/src/http.c b/src/http.c index 754b7eca..5715df65 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;