diff options
author | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-24 09:49:59 +0000 |
---|---|---|
committer | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-24 09:49:59 +0000 |
commit | b3818150149f4d55834924ce6a63a7236fe6e751 (patch) | |
tree | 159a9c148973ec4f57f0e455ac274cba1cc2f5b7 /dir.c | |
parent | 9af2f9e0da00d211d69583585d685321df332e2d (diff) | |
download | ruby-b3818150149f4d55834924ce6a63a7236fe6e751.tar.gz |
* 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/trunk@5824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1188,7 +1188,8 @@ glob_helper(path, dirsep, exist, isdir, beg, end, flags, func, arg) char *buf = join_path(path, dirsep, dp->d_name); enum answer new_isdir = UNKNOWN; - if (recursive && strcmp(dp->d_name, ".") != 0 && strcmp(dp->d_name, "..") != 0) { + if (recursive && strcmp(dp->d_name, ".") != 0 && strcmp(dp->d_name, "..") != 0 + && fnmatch("*", dp->d_name, flags) == 0) { #ifndef _WIN32 if (do_lstat(buf, &st) == 0) new_isdir = S_ISDIR(st.st_mode) ? YES : S_ISLNK(st.st_mode) ? UNKNOWN : NO; |