lib/colors: remove unnecessary goto

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2019-05-20 12:41:12 +02:00
parent 002931c485
commit 9d6852d3a2

View file

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