aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander F. Rødseth <xyproto@archlinux.org>2022-07-22 22:27:05 +0200
committerAllan McRae <allan@archlinux.org>2022-07-29 09:44:04 +1000
commit51b2e1c973e3466471a1762716e96cf502817c0d (patch)
treede6f50edafa3690108f3de36f28a23039c2b00e4
parent5abe1455f26a4e29d4b1b364aaa242b6ccd67b25 (diff)
pacman: let the progress bar "C"/"c" move up and down at a more regular rate
For some terminal widths, the "C"/"c" character does not alternate at regular intervals, but may look like it is stuck at either lowercase or uppercase. The previous behavior toggled based on the character position, while this new behavior toggles the chomp alternation based on the progress percentage value. This leads to slightly improved chomping. Signed-off-by: Alexander F. Rødseth <xyproto@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--src/pacman/callback.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pacman/callback.c b/src/pacman/callback.c
index df4032a4..aa6303bf 100644
--- a/src/pacman/callback.c
+++ b/src/pacman/callback.c
@@ -165,7 +165,7 @@ static void fill_progress(const int percent, const int proglen)
if(i > hashlen - hash) {
putchar('-');
} else if(i == hashlen - hash) {
- if(i % 2 == 0) {
+ if(percent % 2 == 0) {
fputs("\033[1;33mC\033[m", stdout);
} else {
fputs("\033[1;33mc\033[m", stdout);