mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 13:38:34 +00:00
Statically allocate NameBuff
This commit is contained in:
@@ -3540,7 +3540,11 @@ void ex_helpgrep(exarg_T *eap)
|
||||
/* Find all "*.txt" and "*.??x" files in the "doc" directory. */
|
||||
add_pathsep(NameBuff);
|
||||
STRCAT(NameBuff, "doc/*.\\(txt\\|??x\\)");
|
||||
if (gen_expand_wildcards(1, &NameBuff, &fcount,
|
||||
|
||||
// Note: We cannot just do `&NameBuff` because it is a statically sized array
|
||||
// so `NameBuff == &NameBuff` according to C semantics.
|
||||
char_u *buff_list[1] = {(char_u*) NameBuff};
|
||||
if (gen_expand_wildcards(1, buff_list, &fcount,
|
||||
&fnames, EW_FILE|EW_SILENT) == OK
|
||||
&& fcount > 0) {
|
||||
for (fi = 0; fi < fcount && !got_int; ++fi) {
|
||||
|
Reference in New Issue
Block a user