]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: properly turn off color after active column
authorLennart Poettering <lennart@poettering.net>
Tue, 25 Oct 2016 08:00:06 +0000 (10:00 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 2 Nov 2016 17:39:49 +0000 (11:39 -0600)
If we turn on red color for the active column and it is not combined with
underlining, then we need to turn it off explicitly afterwards. Do that.

src/systemctl/systemctl.c

index d311bbec1a086bc02089cb84561adfa7062a5758..558186bd8af371282df60569db6bcc3c4b16edcd 100644 (file)
@@ -513,13 +513,13 @@ static int output_units_list(const UnitInfo *unit_infos, unsigned c) {
                         off_circle = ansi_normal();
                         circle = true;
                         on_loaded = underline ? ansi_highlight_red_underline() : ansi_highlight_red();
-                        off_loaded = on_underline;
+                        off_loaded = underline ? on_underline : ansi_normal();
                 } else if (streq(u->active_state, "failed") && !arg_plain) {
                         on_circle = ansi_highlight_red();
                         off_circle = ansi_normal();
                         circle = true;
                         on_active = underline ? ansi_highlight_red_underline() : ansi_highlight_red();
-                        off_active = on_underline;
+                        off_active = underline ? on_underline : ansi_normal();
                 }
 
                 if (u->machine) {