mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-23 16:28: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:
parent
a23fc08758
commit
89c2c51964
@ -139,8 +139,8 @@ static void fill_progress(const int bar_percent, const int disp_percent,
|
|||||||
}
|
}
|
||||||
/* print percent after progress bar */
|
/* print percent after progress bar */
|
||||||
if(proglen > 5) {
|
if(proglen > 5) {
|
||||||
/* use disp_percent if it is not 0, else show bar_percent */
|
/* show total download percent if option is enabled */
|
||||||
int p = disp_percent ? disp_percent : bar_percent;
|
int p = config->totaldownload ? disp_percent : bar_percent;
|
||||||
printf(" %3d%%", p);
|
printf(" %3d%%", p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user