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

@ -2299,10 +2299,13 @@ expandcmd({string}) *expandcmd()*
like with |expand()|, and environment variables, anywhere in
{string}. "~user" and "~/path" are only expanded at the
start.
Returns the expanded string. Example: >
Returns the expanded string. If an error is encountered
during expansion, the unmodified {string} is returned.
Example: >
:echo expandcmd('make %<.o')
< make /path/runtime/doc/builtin.o ~
< Can also be used as a |method|: >
Can also be used as a |method|: >
GetCommand()->expandcmd()
<
extend({expr1}, {expr2} [, {expr3}]) *extend()*