diff --git a/ChangeLog b/ChangeLog index c28660890e..2091367a49 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Jul 13 10:33:29 2007 Nobuyoshi Nakada + + * array.c (rb_ary_flatten_bang): check argument if valid + integer. [ruby-dev:31197] + Fri Jul 13 10:10:46 2007 Nobuyoshi Nakada * lib/mkmf.rb (link_command, cc_command, cpp_command): do not expand diff --git a/array.c b/array.c index 2dcb2b4856..67f472a826 100644 --- a/array.c +++ b/array.c @@ -1139,7 +1139,6 @@ each_i(VALUE ary) VALUE rb_ary_each(VALUE ary) { - VALUE val; RETURN_ENUMERATOR(ary, 0, 0); ITERATE(each_i, ary); return ary; @@ -2842,7 +2841,7 @@ rb_ary_flatten_bang(int argc, VALUE *argv, VALUE ary) VALUE lv; rb_scan_args(argc, argv, "01", &lv); - if (!NIL_P(lv)) level = FIX2INT(lv); + if (!NIL_P(lv)) level = NUM2INT(lv); if (level == 0) return ary; while (i