To: vim_dev@googlegroups.com Subject: Patch 9.0.0009 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 . // Use 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 . // Use 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 - + [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 -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///