1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-23 00:08:50 -05:00

pacman/callback.c : fix detection of totaldownload

This fixes FS#11180.

The usage of the total percent was detected like this :
/* use disp_percent if it is not 0, else show bar_percent */

However, it is very possible that the total percent is 0 at the beginning,
if the first packages downloaded are very small compared to the total
download.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Xavier Chantry 2008-08-11 23:32:36 +02:00 committed by Dan McGee
parent a23fc08758
commit 89c2c51964

View File

@ -139,8 +139,8 @@ static void fill_progress(const int bar_percent, const int disp_percent,
}
/* print percent after progress bar */
if(proglen > 5) {
/* use disp_percent if it is not 0, else show bar_percent */
int p = disp_percent ? disp_percent : bar_percent;
/* show total download percent if option is enabled */
int p = config->totaldownload ? disp_percent : bar_percent;
printf(" %3d%%", p);
}