]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/colors: remove redundant if statement
authorSami Kerola <kerolasa@iki.fi>
Sat, 18 May 2019 21:56:15 +0000 (22:56 +0100)
committerSami Kerola <kerolasa@iki.fi>
Sat, 18 May 2019 21:56:15 +0000 (22:56 +0100)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
lib/colors.c

index ecec0ac305d9977051e467f66a18bdf619293e85..26f3c81f7f5fb4e9871163149341da89941630f5 100644 (file)
@@ -662,11 +662,9 @@ static int colors_terminal_is_ready(void)
                if (setupterm(NULL, STDOUT_FILENO, &ret) != 0 || ret != 1)
                        goto none;
                ncolors = tigetnum("colors");
-               if (ncolors <= 2)
-                       goto none;
        }
 #endif
-       if (ncolors != -1) {
+       if (1 < ncolors) {
                DBG(CONF, ul_debug("terminal is ready (supports %d colors)", ncolors));
                return 1;
        }