From b026fded7de3ed0ef548c7a34bc0f2074859f23f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Thu, 17 Oct 2024 23:42:08 +0200 Subject: [PATCH] msg: fix clipped output to non-tty Not sure how it got lost. --- common/msg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/msg.c b/common/msg.c index 3c9d3a3b6e..ce7bc9b283 100644 --- a/common/msg.c +++ b/common/msg.c @@ -525,7 +525,7 @@ static void write_term_msg(struct mp_log *log, int lev, bstr text, bstr *out) if (print_term) { int line_w; append_terminal_line(log, lev, line, &root->term_msg_tmp, &line_w, - clip ? term_w : INT_MAX); + clip && term_w ? term_w : INT_MAX); term_msg_lines += (!line_w || !term_w) ? 1 : (line_w + term_w - 1) / term_w; } @@ -536,7 +536,7 @@ static void write_term_msg(struct mp_log *log, int lev, bstr text, bstr *out) int line_w = 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 : INT_MAX); + bstr_eatstart0(&str, TERM_MSG_0) && 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) {