diff --git a/src/ChangeLog b/src/ChangeLog index 04ef9908..2c58a116 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-11-24 Hrvoje Niksic + + * progress.c (bar_update): Don't modify bp->total_length if it is + zero. + 2001-11-24 Hrvoje Niksic * retr.c (retrieve_url): When the redirection URL doesn't parse, diff --git a/src/progress.c b/src/progress.c index a69433f9..9c981bd8 100644 --- a/src/progress.c +++ b/src/progress.c @@ -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