diff options
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r-- | src/nvim/path.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c index ea6390a688..6d460407f8 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -897,9 +897,6 @@ expand_in_path ( { char_u *curdir; garray_T path_ga; - char_u *files = NULL; - char_u *s; /* start */ - char_u *e; /* end */ char_u *paths = NULL; curdir = xmalloc(MAXPATHL); @@ -914,28 +911,8 @@ expand_in_path ( paths = ga_concat_strings(&path_ga); ga_clear_strings(&path_ga); - files = globpath(paths, pattern, (flags & EW_ICASE) ? WILD_ICASE : 0); + globpath(paths, pattern, gap, (flags & EW_ICASE) ? WILD_ICASE : 0); free(paths); - if (files == NULL) - return 0; - - /* Copy each path in files into gap */ - s = e = files; - while (*s != NUL) { - while (*e != '\n' && *e != NUL) - e++; - if (*e == NUL) { - addfile(gap, s, flags); - break; - } else { - /* *e is '\n' */ - *e = NUL; - addfile(gap, s, flags); - e++; - s = e; - } - } - free(files); return gap->ga_len; } |