summaryrefslogtreecommitdiffstats
path: root/dir.c
diff options
context:
space:
mode:
authorocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-02-24 10:03:08 +0000
committerocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-02-24 10:03:08 +0000
commit07e36bb88d57e2cc20510190ffc72c8a265d9480 (patch)
tree2385f8ef3677e3fd183039f765fa1bb70a8bf111 /dir.c
parent0a6c6277c04e2b8ef9950605d557c9d3623d6291 (diff)
downloadruby-07e36bb88d57e2cc20510190ffc72c8a265d9480.tar.gz
ruby-07e36bb88d57e2cc20510190ffc72c8a265d9480.tar.xz
ruby-07e36bb88d57e2cc20510190ffc72c8a265d9480.zip
* dir.c (glob_helper): '**/' should not match leading period
unless File::FNM_DOTMATCH is set. (like '*/') git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@5825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/dir.c b/dir.c
index be537ca23..b26eda4c3 100644
--- a/dir.c
+++ b/dir.c
@@ -981,6 +981,8 @@ glob_helper(path, sub, flags, func, arg)
if (recursive) {
if (strcmp(".", dp->d_name) == 0 || strcmp("..", dp->d_name) == 0)
continue;
+ if (fnmatch("*", dp->d_name, flags) != 0)
+ continue;
buf = ALLOC_N(char, strlen(base)+NAMLEN(dp)+strlen(m)+6);
sprintf(buf, "%s%s%s", base, (BASE) ? "/" : "", dp->d_name);
if (lstat(buf, &st) < 0) {