History

msg: fix clipped output to non-tty

Not sure how it got lost.

Kacper Michajłow committed 2 years ago

Commit b026fde1 parent 6aa33121 file · +2 −2Browse files

Unified · Split

common/msg.c+2−2
@@ -525,7 +525,7 @@ static void write_term_msg(struct mp_log *log, int lev, bstr text, bstr *out) · 524 unmodified lines
525525 if (print_term) {
526526 int line_w;
527527 append_terminal_line(log, lev, line, &root->term_msg_tmp, &line_w,
528− clip ? term_w : INT_MAX);
528+ clip && term_w ? term_w : INT_MAX);
529529 term_msg_lines += (!line_w || !term_w)
530530 ? 1 : (line_w + term_w - 1) / term_w;
531531 }
@@ -536,7 +536,7 @@ static void write_term_msg(struct mp_log *log, int lev, bstr text, bstr *out) · 4 unmodified lines
536536 int line_w = 0;
537537 if (str.len && print_term)
538538 append_terminal_line(log, lev, str, &root->term_msg_tmp, &line_w,
539− bstr_eatstart0(&str, TERM_MSG_0) ? term_w : INT_MAX);
539+ bstr_eatstart0(&str, TERM_MSG_0) && term_w ? term_w : INT_MAX);
540540 term_msg_lines += !term_w ? (str.len ? 1 : 0)
541541 : (line_w + term_w - 1) / term_w;
542542 } else if (str.len) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t