aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/path.c
diff options
context:
space:
mode:
authorScott Prager <splinterofchaos@gmail.com>2014-07-31 20:05:56 -0400
committerScott Prager <splinterofchaos@gmail.com>2014-08-04 12:01:58 -0400
commit5617ee8f352a2ddb61f52e5e0ae7347957d95991 (patch)
treeea02a09468e209540bb487187f82c05825ec0eb1 /src/nvim/path.c
parentb53034d423f055bbcca8b5a030dd51fcf458d182 (diff)
downloadrneovim-5617ee8f352a2ddb61f52e5e0ae7347957d95991.tar.gz
rneovim-5617ee8f352a2ddb61f52e5e0ae7347957d95991.tar.bz2
rneovim-5617ee8f352a2ddb61f52e5e0ae7347957d95991.zip
vim-patch:7.4.279
Problem: globpath() returns a string, making it difficult to get a list of matches. (Greg Novack) Solution: Add an optional argument like with glob(). (Adnan Zafar) https://code.google.com/p/vim/source/detail?r=8e9db1f27a0063df023cc05a760fce73255dad24
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 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;
}