]> sjero.net Git - wget/blobdiff - src/http.c
Fix a failure if the server doesn't specify a content-length and -c is used.
[wget] / src / http.c
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
-          && 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