mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* io.c (prep_stdio): set binmode only if the file descriptor
is not connected to a terminal on Cygwin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
caa55aa13f
commit
38ceb49b79
3 changed files with 12 additions and 5 deletions
6
io.c
6
io.c
|
@ -2792,8 +2792,10 @@ prep_stdio(f, mode, klass)
|
|||
|
||||
MakeOpenFile(io, fp);
|
||||
#ifdef __CYGWIN__
|
||||
mode |= O_BINARY;
|
||||
setmode(fileno(f), O_BINARY);
|
||||
if (!isatty(fileno(f))) {
|
||||
mode |= O_BINARY;
|
||||
setmode(fileno(f), O_BINARY);
|
||||
}
|
||||
#endif
|
||||
fp->f = f;
|
||||
fp->mode = mode;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue