summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-03-31 02:59:57 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-03-31 02:59:57 +0000
commit189febdf243244c963d5a370601eabd4423ac2f7 (patch)
tree99501ac9225787360959adfeceda8bf62f709ffc /io.c
parentd3bb9ea1128c1f98b3aede3228f77a4d79241382 (diff)
* pack.c (pack_pack): raises RangeError if uv is out of UTF8 value
range. [ruby-dev:23281] * io.c (rb_io_binmode): stdio buffer should be empty when calling IO#binmode. [ruby-talk:96155] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/io.c b/io.c
index 637dfeae3e..ef46499920 100644
--- a/io.c
+++ b/io.c
@@ -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);