summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-27 08:03:00 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-27 08:03:00 +0000
commit8ef0192103f9edc4a7193f635a27206b56944637 (patch)
tree8ad0fc3ea939569035eddaa5dfecf68b45791d5b /io.c
parent1e238c5aa2e86dd64d2137968a72b26ad57923c2 (diff)
io.c: copy in binary mode
* io.c (copy_stream_body): should write in binary mode. based on a patch by godfat (Lin Jen-Shin) at [ruby-core:56556]. [ruby-core:56518] [Bug #8767] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/io.c b/io.c
index 5cffc6eeec..8d2ed8d06c 100644
--- a/io.c
+++ b/io.c
@@ -10229,9 +10229,9 @@ copy_stream_body(VALUE arg)
#ifdef O_BINARY
if (src_fptr)
SET_BINARY_MODE_WITH_SEEK_CUR(src_fptr);
- if (dst_fptr)
- setmode(dst_fd, O_BINARY);
#endif
+ if (dst_fptr)
+ rb_io_ascii8bit_binmode(dst_io);
if (stp->src_offset == (off_t)-1 && src_fptr && src_fptr->rbuf.len) {
size_t len = src_fptr->rbuf.len;