format-table: before outputting a color, check if colors are available
authorLennart Poettering <lennart@poettering.net>
Tue, 6 Nov 2018 17:37:21 +0000 (18:37 +0100)
committerLukáš Nykrýn <lnykryn@redhat.com>
Fri, 3 May 2019 10:30:21 +0000 (12:30 +0200)
commit02b72c15a53f694f65a377206fba478db91432cd
treecf40cf655c809d21167bd3eff0413883b1f3865c
parent4ffba0dd993bc461df18fcf59591fc71ab6e6cc8
format-table: before outputting a color, check if colors are available

This is in many cases redundant, as a similar check is done by various
callers already, but in other cases (where we read the color from a
static table for example), it's nice to let the color check be done by
the table code itself, and since it doesn't hurt in the other cases just
do it again.

(cherry picked from commit a22318e55492af721879d8692ed039144696bb08)

Related: #1689832
src/basic/format-table.c