mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 9.0.0009: going past the end of a menu item with only modifier
Problem: Going past the end of a menu item with only modifier. Solution: Check for NUL.
This commit is contained in:
@@ -1820,8 +1820,8 @@ str2special(
|
|||||||
*sp = str + 1;
|
*sp = str + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
// single-byte character or illegal byte
|
// single-byte character, NUL or illegal byte
|
||||||
*sp = str + 1;
|
*sp = str + (*str == NUL ? 0 : 1);
|
||||||
|
|
||||||
// Make special keys and C0 control characters in <> form, also <M-Space>.
|
// Make special keys and C0 control characters in <> form, also <M-Space>.
|
||||||
// Use <Space> only for lhs of a mapping.
|
// Use <Space> only for lhs of a mapping.
|
||||||
|
@@ -528,4 +528,17 @@ func Test_tmenu()
|
|||||||
tunmenu Test
|
tunmenu Test
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_only_modifier()
|
||||||
|
exe "tmenu a.b \x80\xfc0"
|
||||||
|
let exp =<< trim [TEXT]
|
||||||
|
--- Menus ---
|
||||||
|
500 a
|
||||||
|
500 b
|
||||||
|
t - <T-2-^@>
|
||||||
|
[TEXT]
|
||||||
|
call assert_equal(exp, split(execute('tmenu'), "\n"))
|
||||||
|
|
||||||
|
tunmenu a.b
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@@ -735,6 +735,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 */
|
||||||
|
/**/
|
||||||
|
9,
|
||||||
/**/
|
/**/
|
||||||
8,
|
8,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user