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 | 1655f6be28c425977bcb97e730d93bb430b77bfb (patch) | |
| tree | 159a9c148973ec4f57f0e455ac274cba1cc2f5b7 | |
| parent | 3eb3af99bfdb03db6e549c0c974502fb36ca56e2 (diff) | |
| download | ruby-1655f6be28c425977bcb97e730d93bb430b77bfb.tar.gz ruby-1655f6be28c425977bcb97e730d93bb430b77bfb.tar.xz ruby-1655f6be28c425977bcb97e730d93bb430b77bfb.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/trunk@5824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 7 | ||||
| -rw-r--r-- | dir.c | 3 |
2 files changed, 8 insertions, 2 deletions
@@ -1,10 +1,15 @@ +Tue Feb 24 18:42:03 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 18:03:14 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> * test/ruby/test_file.rb (test_fnmatch): test for dir.c:1.108. Tue Feb 24 17:07:17 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp> - * dir.c (fnmatch): File.fnmatch with FNM_PATHNAME was broken + * dir.c (fnmatch): File.fnmatch with File::FNM_PATHNAME was broken for the pattern including '*' followed by '/'. Tue Feb 24 13:22:21 2004 Dave Thomas <dave@pragprog.com> @@ -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; |
