From ad25ede4887875a42a16d3e8336c9119b6877a6d Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 24 May 2024 13:56:47 +0200 Subject: [PATCH] repart: make prefix argument to clear_progress_bar() optional In this case, let's try to override the whole line, not just the first few chars. --- src/shared/pretty-print.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shared/pretty-print.c b/src/shared/pretty-print.c index 8eba052f2c2..f361c4760a0 100644 --- a/src/shared/pretty-print.c +++ b/src/shared/pretty-print.c @@ -532,7 +532,9 @@ void clear_progress_bar(const char *prefix) { fputc('\r', stderr); if (terminal_is_dumb()) - fputs(strrepa(" ", utf8_console_width(prefix) + 4), /* 4: %3.0f%% */ + fputs(strrepa(" ", + prefix ? utf8_console_width(prefix) + 4 : + LESS_BY(columns(), 1U)), /* 4: %3.0f%% */ stderr); else fputs(ANSI_ERASE_TO_END_OF_LINE, stderr); -- 2.47.3