ex_docmd: Fix PVS/V547: condition was already checked in surr. if()

This commit is contained in:
ZyX
2018-04-15 19:36:03 +03:00
parent d7e4449adb
commit cad616c94e

View File

@@ -5669,22 +5669,21 @@ static void do_ucmd(exarg_T *eap)
if (start != NULL) if (start != NULL)
end = vim_strchr(start + 1, '>'); end = vim_strchr(start + 1, '>');
if (buf != NULL) { if (buf != NULL) {
for (ksp = p; *ksp != NUL && *ksp != K_SPECIAL; ++ksp) for (ksp = p; *ksp != NUL && *ksp != K_SPECIAL; ksp++) {
; }
if (*ksp == K_SPECIAL if (*ksp == K_SPECIAL
&& (start == NULL || ksp < start || end == NULL) && (start == NULL || ksp < start || end == NULL)
&& ((ksp[1] == KS_SPECIAL && ksp[2] == KE_FILLER) && (ksp[1] == KS_SPECIAL && ksp[2] == KE_FILLER)) {
)) { // K_SPECIAL has been put in the buffer as K_SPECIAL
/* K_SPECIAL has been put in the buffer as K_SPECIAL // KS_SPECIAL KE_FILLER, like for mappings, but
* KS_SPECIAL KE_FILLER, like for mappings, but // do_cmdline() doesn't handle that, so convert it back.
* do_cmdline() doesn't handle that, so convert it back. // Also change K_SPECIAL KS_EXTRA KE_CSI into CSI.
* Also change K_SPECIAL KS_EXTRA KE_CSI into CSI. */
len = ksp - p; len = ksp - p;
if (len > 0) { if (len > 0) {
memmove(q, p, len); memmove(q, p, len);
q += len; q += len;
} }
*q++ = ksp[1] == KS_SPECIAL ? K_SPECIAL : CSI; *q++ = K_SPECIAL;
p = ksp + 3; p = ksp + 3;
continue; continue;
} }