diff options
author | Igor Gnatenko | 2016-01-22 14:30:39 +0100 |
---|---|---|
committer | Igor Gnatenko | 2016-01-22 14:30:39 +0100 |
commit | 57c7b2a1a56a4c7c3f3534c0b7e92a91dcffe15f (patch) | |
tree | ac53ce6f533fef8e2f7052e9121b0c5910181262 /libsmartcols/src/table_print.c | |
parent | libsmartcols: wrap columns correctly with unicode (diff) | |
download | kernel-qcow2-util-linux-57c7b2a1a56a4c7c3f3534c0b7e92a91dcffe15f.tar.gz kernel-qcow2-util-linux-57c7b2a1a56a4c7c3f3534c0b7e92a91dcffe15f.tar.xz kernel-qcow2-util-linux-57c7b2a1a56a4c7c3f3534c0b7e92a91dcffe15f.zip |
libsmartcols: don't loose colors when wrapping
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Diffstat (limited to 'libsmartcols/src/table_print.c')
-rw-r--r-- | libsmartcols/src/table_print.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libsmartcols/src/table_print.c b/libsmartcols/src/table_print.c index b67640751..ef4e7654b 100644 --- a/libsmartcols/src/table_print.c +++ b/libsmartcols/src/table_print.c @@ -356,6 +356,9 @@ static int print_data(struct libscols_table *tb, char *p = data; i = 0; + if (color) + fputs(color, tb->out); + while (*p) { len = width; p = strdup(p); @@ -373,6 +376,9 @@ static int print_data(struct libscols_table *tb, print_empty_cell (tb, scols_table_get_column(tb, j), NULL, buf->bufsz); } + + if (color) + fputs(UL_COLOR_RESET, tb->out); } else if (color) { char *p = data; size_t art = buffer_get_safe_art_size(buf); |