]> sjero.net Git - wget/commitdiff
[svn] Don't modify bp->total_length if it equals zero.
authorhniksic <devnull@localhost>
Sat, 24 Nov 2001 18:05:57 +0000 (10:05 -0800)
committerhniksic <devnull@localhost>
Sat, 24 Nov 2001 18:05:57 +0000 (10:05 -0800)
src/ChangeLog
src/progress.c

index 04ef9908865815d01d0aa28eb574b070f7132013..2c58a116966b0d7013e4ff228bb66eeba290a2fc 100644 (file)
@@ -1,3 +1,8 @@
+2001-11-24  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * progress.c (bar_update): Don't modify bp->total_length if it is
+       zero.
+
 2001-11-24  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * retr.c (retrieve_url): When the redirection URL doesn't parse,
index a69433f903b7e73a6a27d9c543dea19755c46deb..9c981bd87fc6ec975ecb26f1ef9795a1c94c5caf 100644 (file)
@@ -411,7 +411,8 @@ bar_update (void *progress, long howmuch)
   long dltime = wtimer_elapsed (bp->timer);
 
   bp->count += howmuch;
-  if (bp->count + bp->initial_length > bp->total_length)
+  if (bp->total_length > 0
+      && bp->count + bp->initial_length > bp->total_length)
     /* We could be downloading more than total_length, e.g. when the
        server sends an incorrect Content-Length header.  In that case,
        adjust bp->total_length to the new reality, so that the code in