msg: skip formatting if there is only control char present

This doesn't change behaviour just skips some redundant code early.
This commit is contained in:
Kacper Michajłow 2024-10-20 22:13:48 +02:00
parent 3cf0f8309f
commit 201a39d7fa
1 changed files with 2 additions and 1 deletions

View File

@ -539,9 +539,10 @@ static void write_term_msg(struct mp_log *log, int lev, bstr text, bstr *out)
if (lev == MSGL_STATUS) {
int line_w = 0;
bool clip = bstr_eatstart0(&str, TERM_MSG_0);
if (str.len && print_term)
append_terminal_line(log, lev, str, &root->term_msg_tmp, &line_w,
bstr_eatstart0(&str, TERM_MSG_0) && term_w ? term_w : INT_MAX);
clip && term_w ? term_w : INT_MAX);
term_msg_lines += !term_w ? (str.len ? 1 : 0)
: (line_w + term_w - 1) / term_w;
} else if (str.len) {