From: Karel Zak Date: Mon, 15 Mar 2021 15:19:23 +0000 (+0100) Subject: libsmratcols: print title color only when wanted X-Git-Tag: v2.37-rc1~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef7e258b3d5e5b24a89800710f84497c1461e5f6;p=thirdparty%2Futil-linux.git libsmratcols: print title color only when wanted Reference: 676fb001d6b092470d5390adbd0424dfdecafa3c. Signed-off-by: Karel Zak --- 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;