mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.4426: map() function on string and blob does not check types
Problem: map() function on string and blob does not check argument types at compile time. Solution: Check string and blob argument types. Support "0z1234->func()".
This commit is contained in:
@@ -3457,7 +3457,8 @@ find_ex_command(
|
||||
char_u *pskip = skip_option_env_lead(eap->cmd);
|
||||
|
||||
if (vim_strchr((char_u *)"{('[\"@&$", *p) != NULL
|
||||
|| ((p = to_name_const_end(pskip)) > eap->cmd && *p != NUL))
|
||||
|| ((p = to_name_const_end(pskip)) > eap->cmd && *p != NUL)
|
||||
|| (p[0] == '0' && p[1] == 'z'))
|
||||
{
|
||||
int oplen;
|
||||
int heredoc;
|
||||
@@ -3503,6 +3504,8 @@ find_ex_command(
|
||||
// "'string'->func()" is an expression.
|
||||
|| *eap->cmd == '\''
|
||||
// '"string"->func()' is an expression.
|
||||
|| (eap->cmd[0] == '0' && eap->cmd[1] == 'z')
|
||||
// '"string"->func()' is an expression.
|
||||
|| *eap->cmd == '"'
|
||||
// "g:varname" is an expression.
|
||||
|| eap->cmd[1] == ':'
|
||||
|
Reference in New Issue
Block a user