aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-07-25 13:47:08 -0700
committerJeremy Evans <code@jeremyevans.net>2019-07-30 12:12:59 -0700
commitebc99e026d0ae770b297a93d1f1c1ceeffd13bfc (patch)
tree3056613c4ee5ac179256c200a9fcda888d6eaf4a /io.c
parentd8562ab2a40658db0e6a44ce07cfbe616b9b4078 (diff)
downloadruby-ebc99e026d0ae770b297a93d1f1c1ceeffd13bfc.tar.gz
Do not change IO.pipe encodings if encodings explicitly given
This commit makes it so that if the binmode option is given with any encoding arguments, the reader and writer IO objects are not set to binary encoding. Fixes [Bug #12989]
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index 00d3716839..d0257ff42e 100644
--- a/io.c
+++ b/io.c
@@ -10313,7 +10313,7 @@ rb_io_s_pipe(int argc, VALUE *argv, VALUE klass)
extract_binmode(opt, &fmode);
- if (fmode & FMODE_BINMODE) {
+ if ((fmode & FMODE_BINMODE) && v1 == Qnil) {
rb_io_ascii8bit_binmode(r);
rb_io_ascii8bit_binmode(w);
}