1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* io.c (io_puts_ary): check recursion first. [ruby-dev:34580]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-05-07 08:43:24 +00:00
parent 42981462c9
commit 9757c5450c
2 changed files with 9 additions and 3 deletions

View file

@ -1,3 +1,7 @@
Wed May 7 17:43:22 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (io_puts_ary): check recursion first. [ruby-dev:34580]
Wed May 7 17:41:14 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* vm.c (vm_eval_body): initialize retval. [ruby-dev:34576]

8
io.c
View file

@ -4651,11 +4651,13 @@ io_puts_ary(VALUE ary, VALUE out, int recur)
VALUE tmp;
long i;
if (recur) {
tmp = rb_str_new2("[...]");
rb_io_puts(1, &tmp, out);
return Qnil;
}
for (i=0; i<RARRAY_LEN(ary); i++) {
tmp = RARRAY_PTR(ary)[i];
if (recur) {
tmp = rb_str_new2("[...]");
}
rb_io_puts(1, &tmp, out);
}
return Qnil;