From 89c2c51964d5e4f297e767befb56a65c18dc3d6f Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Mon, 11 Aug 2008 23:32:36 +0200 Subject: 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 Signed-off-by: Dan McGee --- src/pacman/callback.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/pacman/callback.c b/src/pacman/callback.c index f968873f..b8e2d77e 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -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); } -- cgit v1.2.3-70-g09d2