summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-10-30 08:43:28 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-10-30 08:43:28 +0000
commit54d534f04313a0437a613516169cb243b695ccaf (patch)
tree04fc0c8f6e436dbe5025298e3d61851252820e27 /io.c
parent864bc4f18beb189c07a22e605810bb8d6eef5645 (diff)
* string.c (rb_str_chomp_bang): do smart chomp if $/ == '\n'.
* io.c (rb_io_puts): don't treat Array specially. * bignum.c (rb_big_cmp): should convert bignum to float. * eval.c (rb_f_eval): can't modify untainted binding. * regex.c (re_compile_pattern): should preverve p0 value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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);