summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-06 10:07:24 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-06 10:07:24 +0000
commitd1521f4bb267875c9fa9eb6b5a23a81bc4a57002 (patch)
treefd5076c9ead988dee6c2320a878a386fa5aa9a8f /struct.c
parent5ef0d9c7aabf83cd2211739e6f78201bfe7e6c36 (diff)
* struct.c (rb_struct_select): Struct#select should return
enumerator when no block given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/struct.c b/struct.c
index 0a0f217547..f3b8279213 100644
--- a/struct.c
+++ b/struct.c
@@ -774,6 +774,7 @@ rb_struct_select(int argc, VALUE *argv, VALUE s)
if (argc > 0) {
rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
+ RETURN_ENUMERATOR(s, 0, 0);
result = rb_ary_new();
for (i = 0; i < RSTRUCT_LEN(s); i++) {
if (RTEST(rb_yield(RSTRUCT_PTR(s)[i]))) {