From 2e757c243eef7f6a8c4befdbbb38b2737f35abad Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Tue, 28 Feb 2023 20:30:40 +0100 Subject: [PATCH 03/N] fill_progress --- src/pacman/callback.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pacman/callback.c b/src/pacman/callback.c index 76527e4..5d2de3f 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -152,8 +152,11 @@ static int64_t get_update_timediff(int first_call) /* refactored from cb_trans_progress */ static void fill_progress(const int percent, const int proglen) { - /* 8 = 1 space + 1 [ + 1 ] + 5 for percent */ - const int hashlen = proglen > 8 ? proglen - 8 : 0; + /* 9 = 1 space + 1 [ + 1 ] + 5 for percent + 1 blank */ + /* Without the single blank at the end, carriage return wouldn't + * work properly on most windows terminals. + */ + const int hashlen = proglen > 9 ? proglen - 9 : 0; const int hash = percent * hashlen / 100; int i;