diff options
author | Karel Zak | 2019-05-20 12:41:12 +0200 |
---|---|---|
committer | Karel Zak | 2019-05-20 12:41:12 +0200 |
commit | 9d6852d3a23f2c9f40ca74a07f19aef819ccf6fb (patch) | |
tree | d12645a02ceb6f23f9114ad0f5dc9773c3bdc813 /lib | |
parent | Merge branch '2019wk19' of https://github.com/kerolasa/util-linux (diff) | |
download | kernel-qcow2-util-linux-9d6852d3a23f2c9f40ca74a07f19aef819ccf6fb.tar.gz kernel-qcow2-util-linux-9d6852d3a23f2c9f40ca74a07f19aef819ccf6fb.tar.xz kernel-qcow2-util-linux-9d6852d3a23f2c9f40ca74a07f19aef819ccf6fb.zip |
lib/colors: remove unnecessary goto
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/colors.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/colors.c b/lib/colors.c index 26f3c81f7..77d16d08d 100644 --- a/lib/colors.c +++ b/lib/colors.c @@ -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; } |