From 57c7b2a1a56a4c7c3f3534c0b7e92a91dcffe15f Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Fri, 22 Jan 2016 14:30:39 +0100 Subject: [PATCH] libsmartcols: don't loose colors when wrapping Signed-off-by: Igor Gnatenko --- libsmartcols/src/table_print.c | 6 ++++++ 1 file changed, 6 insertions(+) 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);