libsmartcols: don't loose colors when wrapping

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
This commit is contained in:
Igor Gnatenko 2016-01-22 14:30:39 +01:00
parent e6f89163be
commit 57c7b2a1a5
1 changed files with 6 additions and 0 deletions

View File

@ -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);