aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c33
1 files changed, 4 insertions, 29 deletions
diff --git a/io.c b/io.c
index 7dd1f493e0..c33b3e7818 100644
--- a/io.c
+++ b/io.c
@@ -2187,25 +2187,6 @@ rb_f_putc(recv, ch)
return rb_io_putc(rb_defout, ch);
}
-static VALUE rb_io_puts _((int, VALUE*, VALUE));
-
-static VALUE
-io_puts_ary(ary, out)
- VALUE ary, out;
-{
- VALUE tmp;
- int i;
-
- for (i=0; i<RARRAY(ary)->len; i++) {
- tmp = RARRAY(ary)->ptr[i];
- if (rb_inspecting_p(tmp)) {
- tmp = rb_str_new2("[...]");
- }
- rb_io_puts(1, &tmp, out);
- }
- return Qnil;
-}
-
static VALUE
rb_io_puts(argc, argv, out)
int argc;
@@ -2221,18 +2202,12 @@ rb_io_puts(argc, argv, out)
return Qnil;
}
for (i=0; i<argc; i++) {
- switch (TYPE(argv[i])) {
- case T_NIL:
+ if (NIL_P(argv[i])) {
line = rb_str_new2("nil");
- break;
- case T_ARRAY:
- rb_protect_inspect(io_puts_ary, argv[i], out);
- continue;
- default:
- line = argv[i];
- break;
}
- line = rb_obj_as_string(line);
+ else {
+ line = rb_obj_as_string(argv[i]);
+ }
rb_io_write(out, line);
if (RSTRING(line)->ptr[RSTRING(line)->len-1] != '\n') {
rb_io_write(out, rb_default_rs);