vim-patch:8.2.4841: empty string considered an error for expand()

Problem:    Empty string considered an error for expand() when 'verbose' is
            set. (Christian Brabandt)
Solution:   Do not give an error for an empty result. (closes vim/vim#10307)
a96edb736d
This commit is contained in:
zeertzjq
2022-08-23 13:24:40 +08:00
parent d0b9fe2d5a
commit f1b8683b8c
4 changed files with 20 additions and 13 deletions

View File

@@ -2135,7 +2135,8 @@ int expand_wildcards_eval(char_u **pat, int *num_file, char ***file, int flags)
if (*exp_pat == '%' || *exp_pat == '#' || *exp_pat == '<') {
emsg_off++;
eval_pat = eval_vars((char_u *)exp_pat, (char_u *)exp_pat, &usedlen, NULL, &ignored_msg, NULL);
eval_pat = eval_vars((char_u *)exp_pat, (char_u *)exp_pat, &usedlen, NULL, &ignored_msg, NULL,
true);
emsg_off--;
if (eval_pat != NULL) {
exp_pat = (char *)concat_str(eval_pat, (char_u *)exp_pat + usedlen);