From 1bbbca267d05709029a691c36e7c1fe415c9facc Mon Sep 17 00:00:00 2001 From: dundargoc Date: Sun, 8 Oct 2023 00:40:23 +0200 Subject: [PATCH] fix(PVS/V547): expression is always true/false --- src/nvim/ex_docmd.c | 3 --- src/nvim/highlight.c | 2 +- src/nvim/insexpand.c | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index eb89e0fc9d..95490a0a10 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -3142,9 +3142,6 @@ void f_fullcommand(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; - if (name == NULL) { - return; - } while (*name == ':') { name++; diff --git a/src/nvim/highlight.c b/src/nvim/highlight.c index 14239f44cc..337f9e968d 100644 --- a/src/nvim/highlight.c +++ b/src/nvim/highlight.c @@ -332,7 +332,7 @@ void update_window_hl(win_T *wp, bool invalid) wp->w_ns_hl_active = ns_id; wp->w_ns_hl_attr = *(NSHlAttr *)pmap_get(int)(&ns_hl_attr, ns_id); - if (!wp->w_ns_hl_attr) { + if (!wp->w_ns_hl_attr) { // -V547 // No specific highlights, use the defaults. wp->w_ns_hl_attr = highlight_attr; } diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index 3ada39c800..5ac40d7238 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -3309,7 +3309,7 @@ static int ins_compl_get_exp(pos_T *ini) xfree(st.e_cpt_copy); // Make a copy of 'complete', in case the buffer is wiped out. st.e_cpt_copy = xstrdup((compl_cont_status & CONT_LOCAL) ? "." : curbuf->b_p_cpt); - st.e_cpt = st.e_cpt_copy == NULL ? "" : st.e_cpt_copy; + st.e_cpt = st.e_cpt_copy; st.last_match_pos = st.first_match_pos = *ini; } else if (st.ins_buf != curbuf && !buf_valid(st.ins_buf)) { st.ins_buf = curbuf; // In case the buffer was wiped out.