diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-12-10 10:56:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-10 10:56:17 +0100 |
commit | 26eb6051528186270b924c7c806a3f434c233530 (patch) | |
tree | 7229d143d9ce52354cd35d105054bf47d206a5bc /src/nvim/path.c | |
parent | ac2d140a33dfe88f882218e15a443b8300cca6b2 (diff) | |
parent | a59589ca018425f672eb70bf7d2b54d24df49326 (diff) | |
download | rneovim-26eb6051528186270b924c7c806a3f434c233530.tar.gz rneovim-26eb6051528186270b924c7c806a3f434c233530.tar.bz2 rneovim-26eb6051528186270b924c7c806a3f434c233530.zip |
Merge pull request #16597 from bfredl/nomisc1
refactor: move out some long-hanging fruit from misc1.c
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r-- | src/nvim/path.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c index 7b9081eafa..01ac88d537 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -1337,6 +1337,17 @@ int gen_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***fil return ((flags & EW_EMPTYOK) || ga.ga_data != NULL) ? OK : FAIL; } +/// Free the list of files returned by expand_wildcards() or other expansion functions. +void FreeWild(int count, char_u **files) +{ + if (count <= 0 || files == NULL) { + return; + } + while (count--) { + xfree(files[count]); + } + xfree(files); +} /* * Return TRUE if we can expand this backtick thing here. |