summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
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;
}