From ef7e258b3d5e5b24a89800710f84497c1461e5f6 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 15 Mar 2021 16:19:23 +0100 Subject: [PATCH] libsmratcols: print title color only when wanted Reference: 676fb001d6b092470d5390adbd0424dfdecafa3c. Signed-off-by: Karel Zak --- libsmartcols/src/print.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libsmartcols/src/print.c b/libsmartcols/src/print.c index d35445d07c..931d33194a 100644 --- a/libsmartcols/src/print.c +++ b/libsmartcols/src/print.c @@ -883,11 +883,14 @@ int __scols_print_title(struct libscols_table *tb) goto done; } - fputs_color(tb, tb->title.color); + + if (tb->colors_wanted) + fputs_color(tb, tb->title.color); fputs(title, tb->out); - fputs_color_reset(tb); + if (tb->colors_wanted) + fputs_color_reset(tb); fputc('\n', tb->out); rc = 0; -- 2.47.3