diff options
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -3798,7 +3798,12 @@ rb_obj_display(int argc, VALUE *argv, VALUE self) void rb_write_error2(const char *mesg, long len) { - rb_io_write(rb_stderr, rb_str_new(mesg, len)); + if (rb_stderr == orig_stderr || RFILE(orig_stderr)->fptr->fd < 0) { + fwrite(mesg, sizeof(char), len, stderr); + } + else { + rb_io_write(rb_stderr, rb_str_new(mesg, len)); + } } void |