summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-28 12:17:54 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-28 12:17:54 +0000
commit605102f3cb3c1a3e12a6df6adfebd88498da95fe (patch)
treed38b81bc1afb6fa3fc3795883a01becefa71f69a /win32
parent9b663af885784659e61819021095d98603e7d9de (diff)
merge from trunk (r19984, r19985, r19991-r19998)
* io.c (extract_binmode): new function to extract binmode/textmode options from hash. * io.c (rb_io_extract_modeenc): use above function. * io.c (rb_io_s_pipe): recognize binmode/textmode options. * io.c (make_readconv): now can specify the size of cbuf. * io.c (read_all, appendline, io_getc, rb_io_ungetc): follow above change. * win32/win32.c (rb_w32_pipe_exec): internal fds should be always binmode. * test/ruby/test_file.rb (test_each_char_extended_file, test_getbyte_extended_file): add tests. * test/ruby/test_file.rb (test_*_extended_file): test in default/text/ binary mode. * test/ruby/test_file.rb (test_para_gets_extended_file): output file should be binmode. * test/ruby/test_io.rb (test_copy_stream, test_copy_stream_socket): skip some tests if there isn't IO#nonblock=. * test/ruby/test_io.rb (test_close_on_exec): skip if there isn't IO#close_on_exec=. * test/ruby/test_io.rb (test_bytes, test_readbyte): depend on binmode. * test/ruby/test_io.rb (test_sysopen): should specify the mode of IO::for_fd if F_GETFL is not available. * test/ruby/test_io_m17n.rb (test_getc_invalid3): should set binmode if enc is not compatible with ASCII. * test/ruby/test_require.rb (test_require_too_long_filename): too long commandline may be rejected by OS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@19999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/win32/win32.c b/win32/win32.c
index c3a5c8c5dd..13642afa27 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -764,9 +764,8 @@ rb_w32_pipe_exec(const char *cmd, const char *prog, int mode, int *pipe,
reading = TRUE;
writing = FALSE;
}
- mode &= ~(O_RDWR|O_RDONLY|O_WRONLY);
- if (!(mode & O_BINARY))
- mode |= O_TEXT;
+ mode &= ~(O_RDWR|O_RDONLY|O_WRONLY|O_TEXT);
+ mode |= O_BINARY;
sa.nLength = sizeof (SECURITY_ATTRIBUTES);
sa.lpSecurityDescriptor = NULL;