Mercurial > vim
changeset 20047:bdb712c7ecf4 v8.2.0579
patch 8.2.0579: Coverity warns for unused value
Commit: https://github.com/vim/vim/commit/4d5d0dfe9438bd5f2daa41ebbe6ac9a76d165af0
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Apr 14 20:56:31 2020 +0200
patch 8.2.0579: Coverity warns for unused value
Problem: Coverity warns for unused value.
Solution: Change order and use "else if".
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 14 Apr 2020 21:00:04 +0200 |
parents | 23656ac9113c |
children | a400073354d4 |
files | src/os_unix.c src/version.c |
diffstat | 2 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/os_unix.c +++ b/src/os_unix.c @@ -5491,13 +5491,14 @@ mch_job_start(char **argv, job_T *job, j term = getenv("TERM"); #endif // Use 'term' or $TERM if it starts with "xterm", otherwise fall - // back to "xterm". + // back to "xterm" or "xterm-color". if (term == NULL || *term == NUL || STRNCMP(term, "xterm", 5) != 0) { - if (t_colors > 16) + if (t_colors >= 256) + // TODO: should we check this name is supported? + term = "xterm-256color"; + else if (t_colors > 16) term = "xterm-color"; - if (t_colors >= 256) - term = "xterm-256color"; else term = "xterm"; }