diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-14 19:22:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-14 19:22:58 +0000 |
commit | 764402d8b945f7abbfa5f68a6d16c94c635f7ffe (patch) | |
tree | f04a9feedef2357ee3aa9b9eef439447f76f14c3 /libsmartcols/src/print.c | |
parent | Adding debian version 2.40-8. (diff) | |
download | util-linux-764402d8b945f7abbfa5f68a6d16c94c635f7ffe.tar.xz util-linux-764402d8b945f7abbfa5f68a6d16c94c635f7ffe.zip |
Merging upstream version 2.40.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libsmartcols/src/print.c')
-rw-r--r-- | libsmartcols/src/print.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/libsmartcols/src/print.c b/libsmartcols/src/print.c index 88ab5a2..ab279e3 100644 --- a/libsmartcols/src/print.c +++ b/libsmartcols/src/print.c @@ -764,11 +764,11 @@ notree: } } +done: /* reset wrapping after greatest chunk calculation */ if (cal && scols_column_is_wrap(cl)) scols_column_reset_wrap(cl); -done: DBG(COL, ul_debugobj(cl, "__cursor_to_buffer rc=%d", rc)); return rc; } @@ -802,8 +802,12 @@ static int print_line(struct libscols_table *tb, rc = __cursor_to_buffer(tb, buf, 0); if (!rc) rc = print_data(tb, buf); - if (!rc && scols_column_has_pending_wrap(cl)) - pending = 1; + if (!rc) { + if (scols_column_has_pending_wrap(cl)) + pending = 1; + else + scols_column_reset_wrap(cl); + } scols_table_reset_cursor(tb); } fputs_color_line_close(tb); @@ -827,10 +831,12 @@ static int print_line(struct libscols_table *tb, rc = __cursor_to_buffer(tb, buf, 0); if (!rc) rc = print_pending_data(tb, buf); - if (!rc && scols_column_has_pending_wrap(cl)) - pending = 1; - if (!rc && !pending) - scols_column_reset_wrap(cl); + if (!rc) { + if (scols_column_has_pending_wrap(cl)) + pending = 1; + else + scols_column_reset_wrap(cl); + } } else print_empty_cell(tb, cl, ln, NULL, ul_buffer_get_bufsiz(buf)); scols_table_reset_cursor(tb); |