diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-30 17:55:25 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-30 17:55:25 +0000 |
commit | 414605560ff42c7358a61015e04c6a7fa1ca192b (patch) | |
tree | 3a19901ae6cd8850fd694985daa1d8d3761427e1 /io.c | |
parent | d370a79c6908f107dc4ff85d316ea9b523c188fe (diff) | |
download | ruby-414605560ff42c7358a61015e04c6a7fa1ca192b.tar.gz |
* io.c (rb_io_extract_modeenc): should honor value of the
textmode: and binmode: options.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -3922,10 +3922,10 @@ rb_io_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash, else { VALUE v; v = rb_hash_aref(opthash, sym_textmode); - if (!NIL_P(v)) + if (!NIL_P(v) && RTEST(v)) fmode |= FMODE_TEXTMODE; v = rb_hash_aref(opthash, sym_binmode); - if (!NIL_P(v)) { + if (!NIL_P(v) && RTEST(v)) { fmode |= FMODE_BINMODE; #ifdef O_BINARY oflags |= O_BINARY; |