From 87746352f4463bcd4815b2287b3bea3d6b0710f0 Mon Sep 17 00:00:00 2001 From: usa Date: Mon, 25 Aug 2008 14:58:01 +0000 Subject: * win32.c (init_stdhandle): set binmode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ win32/win32.c | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index a5d9cad7bf..22090fd3a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Aug 25 23:56:42 2008 NAKAMURA Usaku + + * win32.c (init_stdhandle): set binmode. + Mon Aug 25 23:38:17 2008 Tadayoshi Funaba * lib/date/format.rb(strftime): can print with given arbitrary 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); } -- cgit v1.2.3