From e65002914138f48fd19df670011e2eab21babb99 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Thu, 22 Dec 2016 15:51:25 +0100 Subject: [PATCH] Ensure to overwrite the latest status line --- cmdline/state.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmdline/state.c b/cmdline/state.c index 31f084e9..60df3c92 100644 --- a/cmdline/state.c +++ b/cmdline/state.c @@ -4128,8 +4128,12 @@ void state_progress_end(struct snapraid_state* state, block_off_t countpos, bloc elapsed = now - state->progress_whole_start - state->progress_wasted; msg_bar("%u%% completed, %u MB accessed", countpos * 100 / countmax, countsize_MB); - if (elapsed >= 60) - msg_bar(" in %u:%02u", (unsigned)(elapsed / 3600), (unsigned)((elapsed % 3600) / 60)); + + msg_bar(" in %u:%02u", (unsigned)(elapsed / 3600), (unsigned)((elapsed % 3600) / 60)); + + /* some extra spaces to ensure to overwrite the latest status line */ + msg_bar(" "); + msg_bar("\n"); msg_flush(); }