Permalink
Browse files

return from first i() if n is equal and less than zero, because rb_it…

…er_break() does not return like CRuby. fix #1496
  • Loading branch information...
1 parent cf2d056 commit 33add5d012b46338ba79691730898cb309267b4c @Watson1978 Watson1978 committed Apr 6, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 range.c
View
@@ -573,6 +573,7 @@ first_i(VALUE i, VALUE *ary)
if (n <= 0) {
rb_iter_break();
+ return Qnil;
}
rb_ary_push(ary[1], i);
n--;

0 comments on commit 33add5d

Please sign in to comment.