1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Minor fix for the new progress bar.

This commit is contained in:
hniksic 2001-11-22 21:09:39 -08:00
parent 8e082d2558
commit eb9a02b828
2 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2001-11-23 Hrvoje Niksic <hniksic@arsdigita.com>
* progress.c (bar_update): If the downloaded amount becomes larger
than the expected amount, adjust the expected amount accordingly.
2001-11-23 Hrvoje Niksic <hniksic@arsdigita.com>
* utils.c (determine_screen_width): New function.

View File

@ -397,6 +397,13 @@ bar_update (void *progress, long howmuch)
long dltime = wtimer_elapsed (bp->timer);
bp->count += howmuch;
if (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
create_image() that depends on total size being smaller or
equal to the expected size doesn't abort. */
bp->total_length = bp->count + bp->initial_length;
if (screen_width != bp->width)
{