diff options
author | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-24 10:03:08 +0000 |
---|---|---|
committer | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-24 10:03:08 +0000 |
commit | 34a78f5670c1453005e1b8c9c7b0095d9594c6ac (patch) | |
tree | 2385f8ef3677e3fd183039f765fa1bb70a8bf111 | |
parent | 571a907ffa76df8d6b55e0857f4bf66bb7882a2a (diff) |
* dir.c (glob_helper): '**/' should not match leading period
unless File::FNM_DOTMATCH is set. (like '*/')
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | dir.c | 2 |
2 files changed, 7 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Tue Feb 24 18:59:37 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp> + + * dir.c (glob_helper): '**/' should not match leading period + unless File::FNM_DOTMATCH is set. (like '*/') + Tue Feb 24 13:22:21 2004 Dave Thomas <dave@pragprog.com> * lib/rdoc/rdoc.rb (RDoc::RDoc::normalized_file_list): Attempt to get better @@ -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) { |