]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libsmratcols: print title color only when wanted
authorKarel Zak <kzak@redhat.com>
Mon, 15 Mar 2021 15:19:23 +0000 (16:19 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 15 Mar 2021 15:19:23 +0000 (16:19 +0100)
Reference: 676fb001d6b092470d5390adbd0424dfdecafa3c.
Signed-off-by: Karel Zak <kzak@redhat.com>
libsmartcols/src/print.c

index d35445d07c26815b58d9c9a8adf6bbcefc64a06e..931d33194a23573148d29c2c78ab951f3c19530e 100644 (file)
@@ -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;