From 06ecf54fdfe5732bac37111753a0e2e3f40ca7ae Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 8 Oct 2014 15:03:48 +0200 Subject: msg: fix unwanted blank lines Was broken in a commit earlier this day. --- common/msg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/msg.c b/common/msg.c index 9ca7da9479..5beb663c9c 100644 --- a/common/msg.c +++ b/common/msg.c @@ -158,6 +158,9 @@ static void prepare_status_line(struct mp_log_root *root, char *new_status) } size_t old_lines = root->status_lines; + if (!new_status[0] && old_lines == 0) + return; // nothing to clear + size_t clear_lines = MPMIN(MPMAX(new_lines, old_lines), root->blank_lines); // clear the status line itself @@ -366,7 +369,6 @@ void mp_msg_va(struct mp_log *log, int lev, const char *format, va_list va) } print_terminal_line(log, lev, text); } - root->buffer[0] = '\0'; } else { int leftover = strlen(text); memmove(root->buffer, text, leftover + 1); -- cgit v1.2.3