io.c: let rb_p use writev
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7da5b32a7d
commit
1b27af8d56
10
io.c
10
io.c
@ -7640,15 +7640,15 @@ rb_f_puts(int argc, VALUE *argv, VALUE recv)
|
|||||||
void
|
void
|
||||||
rb_p(VALUE obj) /* for debug print within C code */
|
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) &&
|
if (RB_TYPE_P(rb_stdout, T_FILE) &&
|
||||||
rb_method_basic_definition_p(CLASS_OF(rb_stdout), id_write)) {
|
rb_method_basic_definition_p(CLASS_OF(rb_stdout), id_write)) {
|
||||||
io_write(rb_stdout, str, 1);
|
io_writev(2, args, rb_stdout);
|
||||||
io_write(rb_stdout, rb_default_rs, 0);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rb_io_write(rb_stdout, str);
|
rb_io_writev(rb_stdout, 2, args);
|
||||||
rb_io_write(rb_stdout, rb_default_rs);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user