From: Lennart Poettering Date: Fri, 24 May 2024 11:56:47 +0000 (+0200) Subject: repart: make prefix argument to clear_progress_bar() optional X-Git-Tag: v257-rc1~1055^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad25ede4887875a42a16d3e8336c9119b6877a6d;p=thirdparty%2Fsystemd.git 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. --- 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);