mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 15:28:17 +00:00
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.
b0967d587f
This commit is contained in:
@@ -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))) {
|
||||
|
Reference in New Issue
Block a user