]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/colors: remove unnecessary goto
authorKarel Zak <kzak@redhat.com>
Mon, 20 May 2019 10:41:12 +0000 (12:41 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 20 May 2019 10:41:12 +0000 (12:41 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/colors.c

index 26f3c81f7f5fb4e9871163149341da89941630f5..77d16d08d716d4c5c5f34b240bab7863bd83d670 100644 (file)
@@ -659,17 +659,16 @@ static int colors_terminal_is_ready(void)
        {
                int ret;
 
-               if (setupterm(NULL, STDOUT_FILENO, &ret) != 0 || ret != 1)
-                       goto none;
-               ncolors = tigetnum("colors");
+               if (setupterm(NULL, STDOUT_FILENO, &ret) == 0 && ret == 1)
+                       ncolors = tigetnum("colors");
        }
 #endif
        if (1 < ncolors) {
                DBG(CONF, ul_debug("terminal is ready (supports %d colors)", ncolors));
                return 1;
        }
-none:
-       DBG(CONF, ul_debug("terminal is NOT ready"));
+
+       DBG(CONF, ul_debug("terminal is NOT ready (no colors)"));
        return 0;
 }