aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/io.c b/io.c
index 1f2af9fb25..cd1c590c41 100644
--- a/io.c
+++ b/io.c
@@ -4485,6 +4485,9 @@ rb_io_putc(VALUE io, VALUE ch)
static VALUE
rb_f_putc(VALUE recv, VALUE ch)
{
+ if (recv == rb_stdout) {
+ return rb_io_putc(recv, ch);
+ }
return rb_funcall2(rb_stdout, rb_intern("putc"), 1, &ch);
}
@@ -4562,8 +4565,11 @@ rb_io_puts(int argc, VALUE *argv, VALUE out)
*/
static VALUE
-rb_f_puts(int argc, VALUE *argv)
+rb_f_puts(int argc, VALUE *argv, VALUE recv)
{
+ if (recv == rb_stdout) {
+ return rb_io_puts(argc, argv, recv);
+ }
return rb_funcall2(rb_stdout, rb_intern("puts"), argc, argv);
}