From fe299a82a683c43d2734268a22b3e97acf8be0c7 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 6 May 2019 10:02:00 +0200 Subject: PVS/V547: Expression is always true Since 67bac681ea6b (see msg_multiline_attr()) msg_clr_eos() is always called. --- src/nvim/eval.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/nvim/eval.c') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 06054b53ec..2a033240a1 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -19811,16 +19811,15 @@ void ex_echo(exarg_T *eap) { char_u *arg = eap->arg; typval_T rettv; - bool needclr = true; bool atstart = true; const int did_emsg_before = did_emsg; if (eap->skip) ++emsg_skip; while (*arg != NUL && *arg != '|' && *arg != '\n' && !got_int) { - /* If eval1() causes an error message the text from the command may - * still need to be cleared. E.g., "echo 22,44". */ - need_clr_eos = needclr; + // If eval1() causes an error message the text from the command may + // still need to be cleared. E.g., "echo 22,44". + need_clr_eos = true; { char_u *p = arg; @@ -19867,11 +19866,11 @@ void ex_echo(exarg_T *eap) if (eap->skip) --emsg_skip; else { - /* remove text that may still be there from the command */ - if (needclr) - msg_clr_eos(); - if (eap->cmdidx == CMD_echo) + // remove text that may still be there from the command + msg_clr_eos(); + if (eap->cmdidx == CMD_echo) { msg_end(); + } } } -- cgit