aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/message.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-08-05 07:57:41 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-08-05 07:58:38 +0800
commit3aef2b8bdf0d451651efc452ca2a44ed2824f0ec (patch)
tree1e26aaa2cf72b86cd354da2f52d4eace20dd8a66 /src/nvim/message.c
parent57fbcc6929e8c2a9da1b17c75c062dc64dcd0a62 (diff)
downloadrneovim-3aef2b8bdf0d451651efc452ca2a44ed2824f0ec.tar.gz
rneovim-3aef2b8bdf0d451651efc452ca2a44ed2824f0ec.tar.bz2
rneovim-3aef2b8bdf0d451651efc452ca2a44ed2824f0ec.zip
vim-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. https://github.com/vim/vim/commit/083692d598139228e101b8c521aaef7bcf256e9a
Diffstat (limited to 'src/nvim/message.c')
-rw-r--r--src/nvim/message.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c
index 621a9212df..7cccd046c9 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -1748,8 +1748,8 @@ const char *str2special(const char **const sp, const bool replace_spaces, const
*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 <M-Space>.