summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-10-13 06:44:42 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-10-13 06:44:42 +0000
commit2e23ebc601fd5c8d7de232e470e2374df8888d11 (patch)
tree15b69a971374cd5d1fd5413ba6d9d659f56c27f0 /dir.c
parentbe1fea072cd0d22788ef8a931c0c6b64a2503b5d (diff)
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/dir.c b/dir.c
index 31116a9fff..642a960b54 100644
--- a/dir.c
+++ b/dir.c
@@ -570,6 +570,14 @@ dir_s_glob(dir, str)
}
if (buf != buffer)
free(buf);
+ if (rb_iterator_p()) {
+ long len = RARRAY(ary)->len;
+ VALUE *ptr = RARRAY(ary)->ptr;
+
+ while (len--) {
+ rb_yield(*ptr++);
+ }
+ }
return ary;
}