diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-11 08:02:36 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-11 08:02:36 +0000 |
commit | 756cd2852d8faea5139b01bfd5e596d6f9e35b14 (patch) | |
tree | 6bc79647b92e8952521ebcec674b1e9e24fd6bc9 /io.c | |
parent | a82d24aa8237d50a8c7d7178d0535327e7ec645c (diff) | |
download | ruby-756cd2852d8faea5139b01bfd5e596d6f9e35b14.tar.gz |
* io.c (extract_binmode): raise error even if binmode and textmode
don't conflict. [Bug #5918] [ruby-core:42199]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -5020,6 +5020,8 @@ extract_binmode(VALUE opthash, int *fmode) if (!NIL_P(v)) { if (*fmode & FMODE_TEXTMODE) rb_raise(rb_eArgError, "textmode specified twice"); + if (*fmode & FMODE_BINMODE) + rb_raise(rb_eArgError, "both textmode and binmode specified"); if (RTEST(v)) *fmode |= FMODE_TEXTMODE; } @@ -5027,6 +5029,8 @@ extract_binmode(VALUE opthash, int *fmode) if (!NIL_P(v)) { if (*fmode & FMODE_BINMODE) rb_raise(rb_eArgError, "binmode specified twice"); + if (*fmode & FMODE_TEXTMODE) + rb_raise(rb_eArgError, "both textmode and binmode specified"); if (RTEST(v)) *fmode |= FMODE_BINMODE; } |