Merge pull request #1019 from splinterofchaos/globpath

vim-patch:7.4.279
This commit is contained in:
Justin M. Keyes
2014-08-18 00:27:07 -04:00
7 changed files with 94 additions and 111 deletions

View File

@@ -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;
}