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:
parent
8e082d2558
commit
eb9a02b828
@ -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.
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user