]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: Fix typo in check for colored output
authorPhil Sutter <phil@nwl.cc>
Wed, 15 Aug 2018 16:21:24 +0000 (18:21 +0200)
committerDavid Ahern <dsahern@gmail.com>
Wed, 15 Aug 2018 16:54:32 +0000 (09:54 -0700)
The check used binary instead of boolean AND, which means colored output
was enabled only if the number of specified '-color' flags was odd.

Fixes: 2d165c0811058 ("tc: implement color output")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: David Ahern <dsahern@gmail.com>
tc/tc.c

diff --git a/tc/tc.c b/tc/tc.c
index a5a654f858bd671de6a7db6d03c2ccd78a2cb423..8d94ce3f704b460297bbdfcb79de01e648384fde 100644 (file)
--- a/tc/tc.c
+++ b/tc/tc.c
@@ -518,7 +518,7 @@ int main(int argc, char **argv)
 
        _SL_ = oneline ? "\\" : "\n";
 
-       if (color & !json)
+       if (color && !json)
                enable_color();
 
        if (batch_file)