mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 23:38:17 +00:00
Merge pull request #1019 from splinterofchaos/globpath
vim-patch:7.4.279
This commit is contained in:
@@ -926,9 +926,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);
|
||||
@@ -943,28 +940,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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user