To: vim_dev@googlegroups.com Subject: Patch 8.0.0666 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0666 Problem: Dead for loop. (Coverity) Solution: Remove the for loop. Files: src/term.c *** ../vim-8.0.0665/src/term.c 2017-06-23 22:45:28.148734856 +0200 --- src/term.c 2017-06-23 22:58:42.874402998 +0200 *************** *** 4601,4659 **** || key_name[0] == KS_SGR_MOUSE || key_name[0] == KS_SGR_MOUSE_RELEASE) { ! for (;;) ! { ! /* URXVT 1015 mouse reporting mode: ! * Almost identical to xterm mouse mode, except the values ! * are decimal instead of bytes. ! * ! * \033[%d;%d;%dM ! * ^-- row ! * ^----- column ! * ^-------- code ! * ! * SGR 1006 mouse reporting mode: ! * Almost identical to xterm mouse mode, except the values ! * are decimal instead of bytes. ! * ! * \033[<%d;%d;%dM ! * ^-- row ! * ^----- column ! * ^-------- code ! * ! * \033[<%d;%d;%dm : mouse release event ! * ^-- row ! * ^----- column ! * ^-------- code ! */ ! p = modifiers_start; ! if (p == NULL) ! return -1; ! ! mouse_code = getdigits(&p); ! if (*p++ != ';') ! return -1; ! ! /* when mouse reporting is SGR, add 32 to mouse code */ ! if (key_name[0] == KS_SGR_MOUSE ! || key_name[0] == KS_SGR_MOUSE_RELEASE) ! mouse_code += 32; ! ! if (key_name[0] == KS_SGR_MOUSE_RELEASE) ! mouse_code |= MOUSE_RELEASE; ! ! mouse_col = getdigits(&p) - 1; ! if (*p++ != ';') ! return -1; ! ! mouse_row = getdigits(&p) - 1; ! ! /* The modifiers were the mouse coordinates, not the ! * modifier keys (alt/shift/ctrl/meta) state. */ ! modifiers = 0; ! ! break; ! } } # endif --- 4601,4654 ---- || key_name[0] == KS_SGR_MOUSE || key_name[0] == KS_SGR_MOUSE_RELEASE) { ! /* URXVT 1015 mouse reporting mode: ! * Almost identical to xterm mouse mode, except the values ! * are decimal instead of bytes. ! * ! * \033[%d;%d;%dM ! * ^-- row ! * ^----- column ! * ^-------- code ! * ! * SGR 1006 mouse reporting mode: ! * Almost identical to xterm mouse mode, except the values ! * are decimal instead of bytes. ! * ! * \033[<%d;%d;%dM ! * ^-- row ! * ^----- column ! * ^-------- code ! * ! * \033[<%d;%d;%dm : mouse release event ! * ^-- row ! * ^----- column ! * ^-------- code ! */ ! p = modifiers_start; ! if (p == NULL) ! return -1; ! ! mouse_code = getdigits(&p); ! if (*p++ != ';') ! return -1; ! ! /* when mouse reporting is SGR, add 32 to mouse code */ ! if (key_name[0] == KS_SGR_MOUSE ! || key_name[0] == KS_SGR_MOUSE_RELEASE) ! mouse_code += 32; ! ! if (key_name[0] == KS_SGR_MOUSE_RELEASE) ! mouse_code |= MOUSE_RELEASE; ! ! mouse_col = getdigits(&p) - 1; ! if (*p++ != ';') ! return -1; ! ! mouse_row = getdigits(&p) - 1; ! ! /* The modifiers were the mouse coordinates, not the ! * modifier keys (alt/shift/ctrl/meta) state. */ ! modifiers = 0; } # endif *** ../vim-8.0.0665/src/version.c 2017-06-23 22:45:28.148734856 +0200 --- src/version.c 2017-06-23 22:59:29.474032648 +0200 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 666, /**/ -- hundred-and-one symptoms of being an internet addict: 78. You find yourself dialing IP numbers on the phone. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///