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
1 changed files with 4 additions and 5 deletions

View 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;
}