summaryrefslogtreecommitdiff
path: root/src/misc1.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-17 16:49:43 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-17 16:49:43 +0100
commitb0967d587fc420fa02832533d4915c85d1a78c17 (patch)
treed830a9672bf1204be394d76857e01c058fd3f1ec /src/misc1.c
parentd0232917ced39ff4838665fbcf379d5116a91aa3 (diff)
downloadvim-git-b0967d587fc420fa02832533d4915c85d1a78c17.tar.gz
patch 7.4.1116v7.4.1116
Problem: delete(x, 'rf') does not delete files starting with a dot. Solution: Also delete files starting with a dot.
Diffstat (limited to 'src/misc1.c')
-rw-r--r--src/misc1.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/misc1.c b/src/misc1.c
index 4f36fd80d..66569d4a0 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -10013,7 +10013,7 @@ dos_expandpath(
if (p[0] == '*' && p[1] == '*')
starstar = TRUE;
- starts_with_dot = (*s == '.');
+ starts_with_dot = *s == '.' || (flags & EW_DODOT);
pat = file_pat_to_reg_pat(s, e, NULL, FALSE);
if (pat == NULL)
{
@@ -10096,7 +10096,8 @@ dos_expandpath(
#endif
/* Ignore entries starting with a dot, unless when asked for. Accept
* all entries found with "matchname". */
- if ((p[0] != '.' || starts_with_dot)
+ if ((p[0] != '.' || (starts_with_dot
+ && p[1] != NUL && (p[1] != '.' || p[2] != NUL)))
&& (matchname == NULL
|| (regmatch.regprog != NULL
&& vim_regexec(&regmatch, p, (colnr_T)0))
@@ -10325,7 +10326,7 @@ unix_expandpath(gap, path, wildoff, flags, didstar)
starstar = TRUE;
/* convert the file pattern to a regexp pattern */
- starts_with_dot = (*s == '.');
+ starts_with_dot = *s == '.' || (flags & EW_DODOT);
pat = file_pat_to_reg_pat(s, e, NULL, FALSE);
if (pat == NULL)
{
@@ -10374,7 +10375,9 @@ unix_expandpath(gap, path, wildoff, flags, didstar)
dp = readdir(dirp);
if (dp == NULL)
break;
- if ((dp->d_name[0] != '.' || starts_with_dot)
+ if ((dp->d_name[0] != '.' || (starts_with_dot
+ && dp->d_name[1] != NUL
+ && (dp->d_name[1] != '.' || dp->d_name[2] != NUL)))
&& ((regmatch.regprog != NULL && vim_regexec(&regmatch,
(char_u *)dp->d_name, (colnr_T)0))
|| ((flags & EW_NOTWILD)