aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-25 12:33:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-25 12:33:42 +0000
commit9c185a7b94b8e2b938df91c047ddf9c54cfc4990 (patch)
tree3488552d614682cca6049d89c4f791f16deef1a4
parentd913238095995ba6e7ca93b55913b8819f07378a (diff)
downloadruby-9c185a7b94b8e2b938df91c047ddf9c54cfc4990.tar.gz
io.c: let rb_p use writev
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--io.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/io.c b/io.c
index 5e44899b7a..64012e77f5 100644
--- a/io.c
+++ b/io.c
@@ -7640,15 +7640,15 @@ rb_f_puts(int argc, VALUE *argv, VALUE recv)
void
rb_p(VALUE obj) /* for debug print within C code */
{
- VALUE str = rb_obj_as_string(rb_inspect(obj));
+ VALUE args[2];
+ args[0] = rb_obj_as_string(rb_inspect(obj));
+ args[1] = rb_default_rs;
if (RB_TYPE_P(rb_stdout, T_FILE) &&
rb_method_basic_definition_p(CLASS_OF(rb_stdout), id_write)) {
- io_write(rb_stdout, str, 1);
- io_write(rb_stdout, rb_default_rs, 0);
+ io_writev(2, args, rb_stdout);
}
else {
- rb_io_write(rb_stdout, str);
- rb_io_write(rb_stdout, rb_default_rs);
+ rb_io_writev(rb_stdout, 2, args);
}
}