summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-25 14:58:01 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-25 14:58:01 +0000
commit87746352f4463bcd4815b2287b3bea3d6b0710f0 (patch)
tree4cf5e84b742a92f999ca51300b8ec28370e60835 /win32
parent3e75a0a7638887519610ca4c96ee7b23e4592d9b (diff)
* win32.c (init_stdhandle): set binmode.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 04a11f3fb8..29088d2f29 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1796,12 +1796,21 @@ init_stdhandle(void)
if (fileno(stdin) < 0) {
stdin->_file = open_null(0);
}
+ else {
+ setmode(fileno(stdin), O_BINARY);
+ }
if (fileno(stdout) < 0) {
stdout->_file = open_null(1);
}
+ else {
+ setmode(fileno(stdout), O_BINARY);
+ }
if (fileno(stderr) < 0) {
stderr->_file = open_null(2);
}
+ else {
+ setmode(fileno(stderr), O_BINARY);
+ }
if (nullfd >= 0 && !keep) close(nullfd);
setvbuf(stderr, NULL, _IONBF, 0);
}