From 0c6103cf50fd3d7c43ff264c9cc9d62c1f723067 Mon Sep 17 00:00:00 2001 From: usa Date: Wed, 14 Dec 2011 10:38:12 +0000 Subject: * win32/win32.c, include/ruby/win32.h (rb_w32_fd_is_text): new function. * win32/win32.c (init_stdhandle): set default mode of stdin as binmode. * io.c (set_binary_mode_with_seek_cur): new function to replace SET_BINARY_MODE_WITH_SEEK_CUR macro. now returns previous mode of the fd and take care of LF in rbuf. * io.c (do_writeconv): set text mode when needed. * io.c (io_read): need to change the mode of the IO to binmode temporally when the length for IO#read, because IO#read with length must behave so. * test/ruby/test_io_m17n.rb (TestIO_M17N#est_{read_with_length, read_with_length_binmode,get[cs]_and_read_with_binmode, read_with_binmode_and_get[cs],read_write_with_binmode}): tests for above changes. all patches are written by Hiroshi Shirosaki. [ruby-core:41496] [Feature #5714] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/win32.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/ruby') diff --git a/include/ruby/win32.h b/include/ruby/win32.h index 83da87a45a..d49a9b4f71 100644 --- a/include/ruby/win32.h +++ b/include/ruby/win32.h @@ -304,6 +304,7 @@ extern int rb_w32_stati64(const char *, struct stati64 *); extern int rb_w32_ustati64(const char *, struct stati64 *); extern int rb_w32_access(const char *, int); extern int rb_w32_uaccess(const char *, int); +extern char rb_w32_fd_is_text(int); #ifdef __BORLANDC__ extern int rb_w32_fstati64(int, struct stati64 *); -- cgit v1.2.3