diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index d5f7a218f4..238beebf3e 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -10,6 +10,7 @@ * ex_getln.c: Functions for entering and editing an Ex command line. */ +#include #include #include #include @@ -3858,8 +3859,10 @@ expand_shellcmd ( STRLCPY(buf + l, pat, MAXPATHL - l); /* Expand matches in one directory of $PATH. */ + char_u **prev_file = *file; ret = expand_wildcards(1, &buf, num_file, file, flags); if (ret == OK) { + assert(*file != prev_file); ga_grow(&ga, *num_file); { for (i = 0; i < *num_file; ++i) {