aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/path.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-08-18 00:27:07 -0400
committerJustin M. Keyes <justinkz@gmail.com>2014-08-18 00:27:07 -0400
commita0e593e26163c730e75a362dcc9e34a645021aff (patch)
treea4ebd7da8d7a5ba8edf9b5cb9fa49d42fd5048b7 /src/nvim/path.c
parent6dcd629ed6e61fbebcf715cd1b362773f1f209ec (diff)
parent5617ee8f352a2ddb61f52e5e0ae7347957d95991 (diff)
downloadrneovim-a0e593e26163c730e75a362dcc9e34a645021aff.tar.gz
rneovim-a0e593e26163c730e75a362dcc9e34a645021aff.tar.bz2
rneovim-a0e593e26163c730e75a362dcc9e34a645021aff.zip
Merge pull request #1019 from splinterofchaos/globpath
vim-patch:7.4.279
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r--src/nvim/path.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c
index 2d819b39a4..0c18ab7bd4 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -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;
}