]> sjero.net Git - wget/commitdiff
Fix -c with servers that don't specify a content-length
authorGiuseppe Scrivano <gscrivano@gnu.org>
Tue, 13 Nov 2012 22:55:29 +0000 (23:55 +0100)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Tue, 13 Nov 2012 22:58:04 +0000 (23:58 +0100)
* retr.c (fd_read_body): Correctly check the return code from
write_data.

NEWS
src/ChangeLog
src/retr.c

diff --git a/NEWS b/NEWS
index 526aab534e67490859526861a5e2126f112f2f79..0a4efd7a8a2fd340213462708b8a5aa845621238 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,8 @@ Please send GNU Wget bug reports to <bug-wget@gnu.org>.
 ** Fix a regression when -c and --content-disposition are used together.
 
 ** Support shorthand URLs in an input file.
+
+** Fix -c with servers that don't specify a content-length.
 \f
 * Changes in Wget 1.14
 
index ec78fe8ca889243b9212a0643343cacf6529fdaa..b7663aed7964dedd3705760cacd3748be583ff9d 100644 (file)
@@ -1,3 +1,9 @@
+2012-11-13  Giuseppe Scrivano  <gscrivano@gnu.org>
+
+       * retr.c (fd_read_body): Correctly check the return code from
+       write_data.
+       Reported by: Torsten Scheck <torsten.scheck@gmx.de>
+
 2012-08-29  Rohit Mathulla <rohit_mathulla@yahoo.com> (tiny change)
 
        * html-url.c (get_urls_file): Convert shorthand URLs.
index 6204839c62c4b331b4a80d0c731ee3fd18134d5e..5bbae8008f056439582ba66f85db9f6091e82e98 100644 (file)
@@ -376,7 +376,7 @@ fd_read_body (int fd, FILE *out, wgint toread, wgint startpos,
         {
           sum_read += ret;
           int write_res = write_data (out, out2, dlbuf, ret, &skip, &sum_written);
-          if (write_res != 0)
+          if (write_res < 0)
             {
               ret = (write_res == -3) ? -3 : -2;
               goto out;