aboutsummaryrefslogtreecommitdiffstats
path: root/dir.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-08 10:43:19 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-08 10:43:19 +0000
commit51b776eb79f90b1c6dc63c24d3a18d821a65adb4 (patch)
tree86d98d1c6000e14bdb687601feebda67c5c7cb78 /dir.c
parent907eed72b25cc274c552800ce323ac5e96af308e (diff)
downloadruby-51b776eb79f90b1c6dc63c24d3a18d821a65adb4.tar.gz
dir.c: fix up r59527
* dir.c (glob_helper): fix up r59527, dot files other than current directory should not be included unless FNM_DOTMATCH is given. [ruby-core:82266] [Bug #13785] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index 39f1ca0252..b7afaec4e0 100644
--- a/dir.c
+++ b/dir.c
@@ -2070,7 +2070,8 @@ glob_helper(
if (p->type == RECURSIVE) {
if (new_pathtype == path_directory || /* not symlink but real directory */
new_pathtype == path_exist) {
- if (dotfile < 2) *new_end++ = p; /* append recursive pattern */
+ if (dotfile < ((flags & FNM_DOTMATCH) ? 2 : 1))
+ *new_end++ = p; /* append recursive pattern */
}
p = p->next; /* 0 times recursion */
}