MSYS2-packages/pacman/0003-fill_progress.patch
Christoph Reiter 1915a138c0 pacman: Update to 6.1.0 (v2)
Same as #4584 but with an additional backport:
https://github.com/msys2/msys2-pacman/pull/49

Old message:

See msys2/msys2-pacman#45

makepkg.conf synced with the upstream version:
https://gitlab.archlinux.org/pacman/pacman/-/blob/v6.1.0/etc/makepkg.conf.in

Skip patches only changing CI configs
2024-05-09 09:45:39 +02:00

28 lines
999 B
Diff

From 2e757c243eef7f6a8c4befdbbb38b2737f35abad Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
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;