Skip to content

Commit

Permalink
* dir.c (glob_helper): '**/' should not match leading period
Browse files Browse the repository at this point in the history
  unless File::FNM_DOTMATCH is set. (like '*/')


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
ocean committed Feb 24, 2004
1 parent 9af2f9e commit b381815
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
Tue Feb 24 18:42:03 Hirokazu Yamamoto <[email protected]>

* 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 <[email protected]>

* test/ruby/test_file.rb (test_fnmatch): test for dir.c:1.108.

Tue Feb 24 17:07:17 Hirokazu Yamamoto <[email protected]>

* 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 <[email protected]>
Expand Down
3 changes: 2 additions & 1 deletion dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b381815

Please sign in to comment.