lib/colors: remove unnecessary goto
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
002931c485
commit
9d6852d3a2
|
@ -659,8 +659,7 @@ static int colors_terminal_is_ready(void)
|
|||
{
|
||||
int ret;
|
||||
|
||||
if (setupterm(NULL, STDOUT_FILENO, &ret) != 0 || ret != 1)
|
||||
goto none;
|
||||
if (setupterm(NULL, STDOUT_FILENO, &ret) == 0 && ret == 1)
|
||||
ncolors = tigetnum("colors");
|
||||
}
|
||||
#endif
|
||||
|
@ -668,8 +667,8 @@ static int colors_terminal_is_ready(void)
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue