diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-01 08:50:49 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-01 08:50:49 +0000 |
commit | 46933426b0a013efe1c978bbd200ea63c9ec644d (patch) | |
tree | 542047c6376c76d72919317b0348778e0a608014 /io.c | |
parent | 4f6c04dc52ba78458bf1263b8ea75dc1440a2fad (diff) | |
download | ruby-46933426b0a013efe1c978bbd200ea63c9ec644d.tar.gz |
* io.c (rb_io_mode_enc): encoding spec is not allowed in binary mode.
[ruby-dev:32913]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -3192,6 +3192,9 @@ rb_io_mode_enc(rb_io_t *fptr, const char *mode) { const char *p = strchr(mode, ':'); if (p) { + if (fptr->mode & FMODE_BINMODE) { + rb_raise(rb_eArgError, "encoding in binary mode"); + } mode_enc(fptr, p+1); } } |