From: Igor Gnatenko Date: Fri, 22 Jan 2016 13:30:39 +0000 (+0100) Subject: libsmartcols: don't loose colors when wrapping X-Git-Tag: v2.28-rc1~162^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57c7b2a1a56a4c7c3f3534c0b7e92a91dcffe15f;p=thirdparty%2Futil-linux.git libsmartcols: don't loose colors when wrapping Signed-off-by: Igor Gnatenko --- diff --git a/libsmartcols/src/table_print.c b/libsmartcols/src/table_print.c index b676407510..ef4e7654b6 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);