summaryrefslogtreecommitdiffstats
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-02-20 18:26:46 +0000
committerBram Moolenaar <Bram@vim.org>2022-02-20 18:26:46 +0000
commitc1e6c7bafec1115b690c745a28e1a6338750b137 (patch)
tree2299cd11918b10569a201ef2f151afbf4ce4602f /src/ex_docmd.c
parenteddd4fc4f6d9d626374a73861c891f95ef999133 (diff)
patch 8.2.4426: map() function on string and blob does not check typesv8.2.4426
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()".
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index f967e6e336..36a7386eb4 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -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] == ':'