aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--array.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 30399973ec..6840553966 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Apr 25 12:37:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (flatten): returns an instance of same class.
+ [ruby-core:16554]
+
Fri Apr 25 10:52:27 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* include/ruby/win32.h: define mode_t for umask.
diff --git a/array.c b/array.c
index c271f5ed8c..18bceeb7c3 100644
--- a/array.c
+++ b/array.c
@@ -2765,7 +2765,7 @@ flatten(VALUE ary, int level, int *modified)
st_data_t id;
stack = rb_ary_new();
- result = rb_ary_new();
+ result = ary_new(rb_class_of(ary), RARRAY_LEN(ary));
memo = st_init_numtable();
st_insert(memo, (st_data_t)ary, (st_data_t)Qtrue);
*modified = 0;