0
0
mirror of https://github.com/vim/vim.git synced 2025-10-07 05:54:16 -04:00

patch 8.0.0666: dead for loop

Problem:    Dead for loop. (Coverity)
Solution:   Remove the for loop.
This commit is contained in:
Bram Moolenaar
2017-06-23 23:00:08 +02:00
parent 090209bfbd
commit 5fe691240b
2 changed files with 44 additions and 47 deletions

View File

@@ -4601,59 +4601,54 @@ check_termcode(
|| key_name[0] == KS_SGR_MOUSE || key_name[0] == KS_SGR_MOUSE
|| key_name[0] == KS_SGR_MOUSE_RELEASE) || key_name[0] == KS_SGR_MOUSE_RELEASE)
{ {
for (;;) /* URXVT 1015 mouse reporting mode:
{ * Almost identical to xterm mouse mode, except the values
/* URXVT 1015 mouse reporting mode: * are decimal instead of bytes.
* Almost identical to xterm mouse mode, except the values *
* are decimal instead of bytes. * \033[%d;%d;%dM
* * ^-- row
* \033[%d;%d;%dM * ^----- column
* ^-- row * ^-------- code
* ^----- column *
* ^-------- code * SGR 1006 mouse reporting mode:
* * Almost identical to xterm mouse mode, except the values
* SGR 1006 mouse reporting mode: * are decimal instead of bytes.
* Almost identical to xterm mouse mode, except the values *
* are decimal instead of bytes. * \033[<%d;%d;%dM
* * ^-- row
* \033[<%d;%d;%dM * ^----- column
* ^-- row * ^-------- code
* ^----- column *
* ^-------- code * \033[<%d;%d;%dm : mouse release event
* * ^-- row
* \033[<%d;%d;%dm : mouse release event * ^----- column
* ^-- row * ^-------- code
* ^----- column */
* ^-------- code p = modifiers_start;
*/ if (p == NULL)
p = modifiers_start; return -1;
if (p == NULL)
return -1;
mouse_code = getdigits(&p); mouse_code = getdigits(&p);
if (*p++ != ';') if (*p++ != ';')
return -1; return -1;
/* when mouse reporting is SGR, add 32 to mouse code */ /* when mouse reporting is SGR, add 32 to mouse code */
if (key_name[0] == KS_SGR_MOUSE if (key_name[0] == KS_SGR_MOUSE
|| key_name[0] == KS_SGR_MOUSE_RELEASE) || key_name[0] == KS_SGR_MOUSE_RELEASE)
mouse_code += 32; mouse_code += 32;
if (key_name[0] == KS_SGR_MOUSE_RELEASE) if (key_name[0] == KS_SGR_MOUSE_RELEASE)
mouse_code |= MOUSE_RELEASE; mouse_code |= MOUSE_RELEASE;
mouse_col = getdigits(&p) - 1; mouse_col = getdigits(&p) - 1;
if (*p++ != ';') if (*p++ != ';')
return -1; return -1;
mouse_row = getdigits(&p) - 1; mouse_row = getdigits(&p) - 1;
/* The modifiers were the mouse coordinates, not the /* The modifiers were the mouse coordinates, not the
* modifier keys (alt/shift/ctrl/meta) state. */ * modifier keys (alt/shift/ctrl/meta) state. */
modifiers = 0; modifiers = 0;
break;
}
} }
# endif # endif

View File

@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
666,
/**/ /**/
665, 665,
/**/ /**/