diff options
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -2133,6 +2133,9 @@ rb_io_binmode(io) OpenFile *fptr; GetOpenFile(io, fptr); + if ((fptr->mode & FMODE_BINMODE) && READ_DATA_BUFFERED(fptr->f)) { + rb_raise(rb_eIOError, "buffer already filled with text-mode content"); + } #ifdef __human68k__ if (fptr->f) fmode(fptr->f, _IOBIN); |