diff options
author | Jurica Bradaric <jbradaric@gmail.com> | 2016-02-28 12:59:13 +0100 |
---|---|---|
committer | Jurica Bradaric <jbradaric@gmail.com> | 2016-04-20 08:25:51 +0200 |
commit | 9e385404b3443f201f1092ba76bcdafd1f303976 (patch) | |
tree | c40d939240c2d751bdc7feb9f6aeac39a03fcb65 /src/nvim/path.c | |
parent | 88a735166b7ee1eadaf6d46be11804dc0e1a251a (diff) | |
download | rneovim-9e385404b3443f201f1092ba76bcdafd1f303976.tar.gz rneovim-9e385404b3443f201f1092ba76bcdafd1f303976.tar.bz2 rneovim-9e385404b3443f201f1092ba76bcdafd1f303976.zip |
vim-patch:7.4.1116
Problem: delete(x, 'rf') does not delete files starting with a dot.
Solution: Also delete files starting with a dot.
https://github.com/vim/vim/commit/b0967d587fc420fa02832533d4915c85d1a78c17
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r-- | src/nvim/path.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c index aaf54bc5b4..8ba3fe3358 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -604,8 +604,8 @@ 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 == '.'); - char_u *pat = file_pat_to_reg_pat(s, e, NULL, false); + int starts_with_dot = *s == '.' || (flags & EW_DODOT); + char_u *pat = file_pat_to_reg_pat(s, e, NULL, FALSE); if (pat == NULL) { xfree(buf); return 0; @@ -649,7 +649,9 @@ 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) + if ((name[0] != '.' || (starts_with_dot + && 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))) { |