0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.4679: cannot have expandcmd() give an error message for mistakes

Problem:    Cannot have expandcmd() give an error message for mistakes.
Solution:   Add an optional argument to give errors. Fix memory leak when
            expanding files fails. (Yegappan Lakshmanan, closes #10071)
This commit is contained in:
Yegappan Lakshmanan
2022-04-03 21:30:32 +01:00
committed by Bram Moolenaar
parent 1061195057
commit 2b74b6805b
6 changed files with 50 additions and 13 deletions

View File

@@ -3999,7 +3999,7 @@ gen_expand_wildcards(
// When returning FAIL the array must be freed here.
if (retval == FAIL)
ga_clear(&ga);
ga_clear_strings(&ga);
*num_file = ga.ga_len;
*file = (ga.ga_data != NULL) ? (char_u **)ga.ga_data