Patch 9.0.0009
Problem: Going past the end of a menu item with only modifier.
Solution: Check for NUL.
Files: src/message.c, src/testdir/test_menu.vim
*** ../vim-9.0.0008/src/message.c 2022-06-26 11:16:31.000000000 +0100
--- src/message.c 2022-06-29 21:15:30.317379875 +0100
***************
*** 1820,1827 ****
*sp = str + 1;
}
else
! // single-byte character or illegal byte
! *sp = str + 1;
// Make special keys and C0 control characters in <> form, also <M-Space>.
// Use <Space> only for lhs of a mapping.
--- 1820,1827 ----
*sp = str + 1;
}
else
! // single-byte character, NUL or illegal byte
! *sp = str + (*str == NUL ? 0 : 1);
// Make special keys and C0 control characters in <> form, also <M-Space>.
// Use <Space> only for lhs of a mapping.
*** ../vim-9.0.0008/src/testdir/test_menu.vim 2021-09-30 18:47:39.000000000
+0100
--- src/testdir/test_menu.vim 2022-06-29 21:13:31.077731869 +0100
***************
*** 528,531 ****
--- 528,544 ----
tunmenu Test
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-9.0.0008/src/version.c 2022-06-29 20:24:46.110172347 +0100
--- src/version.c 2022-06-29 21:03:29.024621478 +0100
***************
*** 737,738 ****
--- 737,740 ----
{ /* Add new patch number below this line */
+ /**/
+ 9,
/**/
--
How To Keep A Healthy Level Of Insanity:
18. When leaving the zoo, start running towards the parking lot,
yelling "run for your lives, they're loose!!"
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20220629201726.7025F1C0390%40moolenaar.net.