* dir.c (glob_helper): Dir.glob('**/') did not work.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ocean 2004-02-08 01:07:09 +00:00
parent 208adf5c1f
commit 3a8647ea9f

5
dir.c
View File

@ -994,7 +994,8 @@ glob_make_pattern(p, flags)
while (*p) {
tmp = ALLOC(struct glob_pattern);
if (p[0] == '*' && p[1] == '*' && p[2] == '/') {
do { p += 3; } while (p[0] == '*' && p[1] == '*' && p[2] == '/'); /* fold continuous RECURSIVEs */
/* fold continuous RECURSIVEs */
do { p += 3; } while (p[0] == '*' && p[1] == '*' && p[2] == '/');
tmp->type = RECURSIVE;
tmp->str = 0;
dirsep = 1;
@ -1149,6 +1150,7 @@ glob_helper(path, dirsep, exist, isdir, beg, end, flags, func, arg)
}
}
if (*path) {
if (match_all && exist == UNKNOWN) {
if (do_lstat(path, &st) == 0) {
exist = YES;
@ -1182,6 +1184,7 @@ glob_helper(path, dirsep, exist, isdir, beg, end, flags, func, arg)
free(buf);
if (status) return status;
}
}
if (exist == NO || isdir == NO) return 0;