summaryrefslogtreecommitdiffstats
path: root/lib/colors.c
diff options
context:
space:
mode:
authorKarel Zak2019-05-20 12:35:38 +0200
committerKarel Zak2019-05-20 12:35:38 +0200
commit002931c485dd66c23b63750a7d9d09637e9bc1ef (patch)
treef4209fc28f52b9aa6159af0afb43b43f07b4326f /lib/colors.c
parentMerge branch 'lscpu_midr_updates' of https://github.com/jlinton/util-linux (diff)
parentlib/colors: remove redundant if statement (diff)
downloadkernel-qcow2-util-linux-002931c485dd66c23b63750a7d9d09637e9bc1ef.tar.gz
kernel-qcow2-util-linux-002931c485dd66c23b63750a7d9d09637e9bc1ef.tar.xz
kernel-qcow2-util-linux-002931c485dd66c23b63750a7d9d09637e9bc1ef.zip
Merge branch '2019wk19' of https://github.com/kerolasa/util-linux
* '2019wk19' of https://github.com/kerolasa/util-linux: lib/colors: remove redundant if statement wipefs: fix variable / function shadowing [cppcheck] sulogin: fix variable / function shadowing [cppcheck] lscpu: remove redundant condition check [cppcheck] libmount: avoid possible null pointer dereference [cppcheck] lib/mangle: fix possible null pointer dereference [cppcheck] sfdisk: remove unnecessary size check [cppcheck]
Diffstat (limited to 'lib/colors.c')
-rw-r--r--lib/colors.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/colors.c b/lib/colors.c
index ecec0ac30..26f3c81f7 100644
--- a/lib/colors.c
+++ b/lib/colors.c
@@ -662,11 +662,9 @@ static int colors_terminal_is_ready(void)
if (setupterm(NULL, STDOUT_FILENO, &ret) != 0 || ret != 1)
goto none;
ncolors = tigetnum("colors");
- if (ncolors <= 2)
- goto none;
}
#endif
- if (ncolors != -1) {
+ if (1 < ncolors) {
DBG(CONF, ul_debug("terminal is ready (supports %d colors)", ncolors));
return 1;
}