Fix -c with servers that don't specify a content-length

* retr.c (fd_read_body): Correctly check the return code from
write_data.
This commit is contained in:
Giuseppe Scrivano 2012-11-13 23:55:29 +01:00
parent 98f843f3cc
commit b1838bdfd1
3 changed files with 9 additions and 1 deletions

2
NEWS
View File

@ -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.
* Changes in Wget 1.14

View 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.

View 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;