summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--struct.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index e74f755b95..33124ba8ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Oct 6 18:56:09 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * struct.c (rb_struct_select): Struct#select should return
+ enumerator when no block given.
+
Tue Oct 6 06:26:00 2009 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* * ext/tk/lib/tk/canvas.rb: *** POTENTIALLY INCOMPATIBLE ***
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]))) {