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 vim/vim#10063)
5018a836c0
This commit is contained in:
zeertzjq
2022-08-20 06:51:06 +08:00
parent 6d6e9c5d51
commit 15ca01b649
3 changed files with 25 additions and 16 deletions

View File

@@ -2052,10 +2052,10 @@ static void f_expandcmd(typval_T *argvars, typval_T *rettv, FunPtr fptr)
};
eap.argt |= EX_NOSPC;
emsg_off++;
expand_filename(&eap, &cmdstr, &errormsg);
if (errormsg != NULL && *errormsg != NUL) {
emsg(errormsg);
}
emsg_off--;
rettv->vval.v_string = cmdstr;
}