index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | morganamilo <morganamilo@archlinux.org> | 2021-04-19 10:36:14 +0100 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2021-04-19 23:53:42 +1000 |
commit | abdb4d7fa699ae3b8ff09ba79656f6853b9a1357 (patch) | |
tree | 76904d0d74b1961f40ca5c65a1899aa19e938dc2 /src | |
parent | 0699321b3ce71c46fbd0a10fede3959d0fac7009 (diff) |
-rw-r--r-- | src/pacman/callback.c | 12 |
diff --git a/src/pacman/callback.c b/src/pacman/callback.c index a28a79a9..0a9aa4b7 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -811,12 +811,8 @@ static void draw_pacman_progress_bar(struct pacman_progress_bar *bar) /* 1 space + filenamelen + 1 space + 6 for size + 1 space + 3 for label + * + 2 spaces + 4 for rate + 1 space + 3 for label + 2 for /s + 1 space + - * 8 for eta, gives us the magic 33 */ - filenamelen = infolen - 33; - /* see printf() code, we omit 'HH:' in these conditions */ - if(eta_h == 0 || eta_h >= 100) { - filenamelen += 3; - } + * 5 for eta, gives us the magic 30 */ + filenamelen = infolen - 30; /* In order to deal with characters from all locales, we have to worry * about wide characters and their column widths. A lot of stuff is @@ -860,8 +856,8 @@ static void draw_pacman_progress_bar(struct pacman_progress_bar *bar) } if(eta_h == 0) { printf("%02u:%02u", eta_m, eta_s); - } else if(eta_h < 100) { - printf("%02u:%02u:%02u", eta_h, eta_m, eta_s); + } else if(eta_h == 1 && eta_m < 40) { + printf("%02u:%02u", eta_m + 60, eta_s); } else { fputs("--:--", stdout); } |