lib/colors: remove unnecessary goto
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
002931c485
commit
9d6852d3a2
1 changed files with 4 additions and 5 deletions
|
@ -659,8 +659,7 @@ 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
|
||||||
|
@ -668,8 +667,8 @@ static int colors_terminal_is_ready(void)
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue