]> sjero.net Git - wget/commitdiff
Fix a failure if the server doesn't specify a content-length and -c is used.
authorAlan Jenkins <alan-jenkins@tuffmail.co.uk>
Tue, 20 Jul 2010 17:42:13 +0000 (19:42 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Tue, 20 Jul 2010 17:42:13 +0000 (19:42 +0200)
src/ChangeLog
src/http.c

index 30b6c9cc7e908f32e92fb797f8708b0a94874589..5c8dea7ad3b90fd2d3634ad626ff9cbdc6d69630 100644 (file)
@@ -1,3 +1,8 @@
+2010-07-20  Alan Jenkins <alan-jenkins@tuffmail.co.uk> (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 <nouser@lpetrov.net>
 
        * ftp.c (getftp): Don't attempt to retrieve the file if it is already
 2010-07-20  Leonid Petrov <nouser@lpetrov.net>
 
        * ftp.c (getftp): Don't attempt to retrieve the file if it is already
index 28fd24f91807798b14c008b44c3c6851811625fe..1c1e165ceea0629e7f85aa7b379cd1663753bbf8 100644 (file)
@@ -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
 
   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
     {
       /* If `-c' is in use and the file has been fully downloaded (or
          the remote file has shrunk), Wget effectively requests bytes