From b1838bdfd197ec970d834ce5042995df92516841 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Tue, 13 Nov 2012 23:55:29 +0100 Subject: [PATCH] Fix -c with servers that don't specify a content-length * retr.c (fd_read_body): Correctly check the return code from write_data. --- NEWS | 2 ++ src/ChangeLog | 6 ++++++ src/retr.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 526aab53..0a4efd7a 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,8 @@ Please send GNU Wget bug reports to . ** 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. * Changes in Wget 1.14 diff --git a/src/ChangeLog b/src/ChangeLog index ec78fe8c..b7663aed 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-11-13 Giuseppe Scrivano + + * retr.c (fd_read_body): Correctly check the return code from + write_data. + Reported by: Torsten Scheck + 2012-08-29 Rohit Mathulla (tiny change) * html-url.c (get_urls_file): Convert shorthand URLs. diff --git a/src/retr.c b/src/retr.c index 6204839c..5bbae800 100644 --- a/src/retr.c +++ b/src/retr.c @@ -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; -- 2.39.2