diff options
author | Jurica Bradaric <jbradaric@gmail.com> | 2016-02-28 13:21:01 +0100 |
---|---|---|
committer | Jurica Bradaric <jbradaric@gmail.com> | 2016-04-20 08:25:51 +0200 |
commit | 29b737e92b5865918ca1e8c5a30e6c6f3a351915 (patch) | |
tree | 72fac413a8999450b9bbc5610e742ee51d91420e /src/nvim/path.c | |
parent | a252fca38e0e5bf8501b72c2a9cfd2acf1cf9fff (diff) | |
download | rneovim-29b737e92b5865918ca1e8c5a30e6c6f3a351915.tar.gz rneovim-29b737e92b5865918ca1e8c5a30e6c6f3a351915.tar.bz2 rneovim-29b737e92b5865918ca1e8c5a30e6c6f3a351915.zip |
vim-patch:7.4.1117
Problem: No longer get "." and ".." in directory list.
Solution: Do not skip "." and ".." unless EW_DODOT is set.
https://github.com/vim/vim/commit/d82103ed8534a1207742e9666ac7ef1e47dda12d
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r-- | src/nvim/path.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c index 4b15afbfc1..a6e8aa6236 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -604,7 +604,7 @@ static size_t do_path_expand(garray_T *gap, const char_u *path, starstar = true; // convert the file pattern to a regexp pattern - int starts_with_dot = *s == '.' || (flags & EW_DODOT); + int starts_with_dot = *s == '.'; char_u *pat = file_pat_to_reg_pat(s, e, NULL, false); if (pat == NULL) { xfree(buf); @@ -649,9 +649,10 @@ static size_t do_path_expand(garray_T *gap, const char_u *path, char_u *name; scandir_next_with_dots(NULL); // initialize while ((name = (char_u *) scandir_next_with_dots(&dir)) && name != NULL) { - if ((name[0] != '.' || (starts_with_dot - && name[1] != NUL - && (name[1] != '.' || name[2] != NUL))) + if ((name[0] != '.' + || starts_with_dot + || ((flags & EW_DODOT) + && name[1] != NUL && (name[1] != '.' || name[2] != NUL))) && ((regmatch.regprog != NULL && vim_regexec(®match, name, 0)) || ((flags & EW_NOTWILD) && fnamencmp(path + (s - buf), name, e - s) == 0))) { |