diff options
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1243,6 +1243,8 @@ io_write(VALUE io, VALUE str, int nosync) io = tmp; if (RSTRING_LEN(str) == 0) return INT2FIX(0); + str = rb_str_new_frozen(str); + GetOpenFile(io, fptr); rb_io_check_writable(fptr); @@ -4219,6 +4221,8 @@ rb_io_syswrite(VALUE io, VALUE str) GetOpenFile(io, fptr); rb_io_check_writable(fptr); + str = rb_str_new_frozen(str); + if (fptr->wbuf.len) { rb_warn("syswrite for buffered IO"); } |