1
0
forked from aniani/vim

patch 8.2.4667: expandcmd() fails on an error

Problem:    expandcmd() fails on an error.
Solution:   On failure return the command unmodified. (yegappan Lakshmanan,
            closes #10063)
This commit is contained in:
Yegappan Lakshmanan
2022-04-02 21:12:21 +01:00
committed by Bram Moolenaar
parent 97f8c1081e
commit 5018a836c0
4 changed files with 27 additions and 17 deletions

View File

@@ -4168,9 +4168,9 @@ f_expandcmd(typval_T *argvars, typval_T *rettv)
eap.nextcmd = NULL;
eap.cmdidx = CMD_USER;
++emsg_off;
expand_filename(&eap, &cmdstr, &errormsg);
if (errormsg != NULL && *errormsg != NUL)
emsg(errormsg);
--emsg_off;
rettv->vval.v_string = cmdstr;
}
@@ -4444,8 +4444,7 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref)
arg_idx = 0;
else if (list->lv_len > MAX_FUNC_ARGS)
{
emsg_funcname((char *)e_too_many_arguments_for_function_str,
s);
emsg_funcname(e_too_many_arguments_for_function_str, s);
vim_free(name);
goto theend;
}