diff --git a/src/message.c b/src/message.c index 02380e9177c2e..becb2804d00c3 100644 --- a/src/message.c +++ b/src/message.c @@ -1820,8 +1820,8 @@ str2special( *sp = str + 1; } else - // single-byte character or illegal byte - *sp = str + 1; + // 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. diff --git a/src/testdir/test_menu.vim b/src/testdir/test_menu.vim index c867162e5bbd5..df717cc8a75c5 100644 --- a/src/testdir/test_menu.vim +++ b/src/testdir/test_menu.vim @@ -528,4 +528,17 @@ func Test_tmenu() 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 diff --git a/src/version.c b/src/version.c index ea1cc16c715ca..003984ab6617e 100644 --- a/src/version.c +++ b/src/version.c @@ -735,6 +735,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 9, /**/ 8, /**/