comparison src/message.c @ 29332:a538982f74ea v9.0.0009

patch 9.0.0009: going past the end of a menu item with only modifier Commit: https://github.com/vim/vim/commit/083692d598139228e101b8c521aaef7bcf256e9a Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jun 29 21:16:58 2022 +0100 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.
author Bram Moolenaar <Bram@vim.org>
date Wed, 29 Jun 2022 22:30:03 +0200
parents d9acbf59032c
children 87980a7936e7
comparison
equal deleted inserted replaced
29331:d78c62e61b42 29332:a538982f74ea
1818 else 1818 else
1819 // illegal byte 1819 // illegal byte
1820 *sp = str + 1; 1820 *sp = str + 1;
1821 } 1821 }
1822 else 1822 else
1823 // single-byte character or illegal byte 1823 // single-byte character, NUL or illegal byte
1824 *sp = str + 1; 1824 *sp = str + (*str == NUL ? 0 : 1);
1825 1825
1826 // Make special keys and C0 control characters in <> form, also <M-Space>. 1826 // Make special keys and C0 control characters in <> form, also <M-Space>.
1827 // Use <Space> only for lhs of a mapping. 1827 // Use <Space> only for lhs of a mapping.
1828 if (special || c < ' ' || (from && c == ' ')) 1828 if (special || c < ' ' || (from && c == ' '))
1829 return get_special_key_name(c, modifiers); 1829 return get_special_key_name(c, modifiers);