From: Alan Jenkins Date: Tue, 20 Jul 2010 17:42:13 +0000 (+0200) Subject: Fix a failure if the server doesn't specify a content-length and -c is used. X-Git-Tag: v1.13~119 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=954fead685de2cc972552ed1b294a84845cf638a Fix a failure if the server doesn't specify a content-length and -c is used. --- diff --git a/src/ChangeLog b/src/ChangeLog index 30b6c9cc..5c8dea7a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-07-20 Alan Jenkins (tiny change) + + * http.c (gethttp): Check content-length was set before trying to + compare it with the already downloded filesize. + 2010-07-20 Leonid Petrov * ftp.c (getftp): Don't attempt to retrieve the file if it is already diff --git a/src/http.c b/src/http.c index 28fd24f9..1c1e165c 100644 --- a/src/http.c +++ b/src/http.c @@ -2377,7 +2377,7 @@ File %s already there; not retrieving.\n\n"), quote (hs->local_file)); if (statcode == HTTP_STATUS_RANGE_NOT_SATISFIABLE || (!opt.timestamping && hs->restval > 0 && statcode == HTTP_STATUS_OK - && contrange == 0 && hs->restval >= contlen)) + && contrange == 0 && contlen >= 0 && hs->restval >= contlen)) { /* If `-c' is in use and the file has been fully downloaded (or the remote file has shrunk), Wget effectively requests bytes