From add77a592bee645aa6787130db384afc11482a04 Mon Sep 17 00:00:00 2001 From: usa Date: Mon, 7 Nov 2011 17:48:11 +0000 Subject: * include/ruby/encoding.h (ECONV_NEWLINE_DECORATOR_READ_MASK, ECONV_NEWLINE_DECORATOR_WRITE_MASK): new macro. * io.c (rb_io_extract_modeenc, pipe_open, prep_stdio, argf_next_argv): set TEXTMODE_NEWLINE_DECORATOR_ON_WRITE for textmode on creating IO if the flag is available. * io.c (make_writeconv): drop decorators for reading. * io.c (make_readconv): drop decorators for writing. * io.c (do_writeconv): existing writeconv is not the condition to raise ArgumentError. should check textmode or not. * test/ruby/test_io_m17n.rb (TestIO_M17N#test_{cr,lf,crlf}_decorator_on_stdout): test above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/encoding.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/ruby/encoding.h') diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h index 123f76aff5..4a046af136 100644 --- a/include/ruby/encoding.h +++ b/include/ruby/encoding.h @@ -305,6 +305,8 @@ void rb_econv_binmode(rb_econv_t *ec); #define ECONV_DECORATOR_MASK 0x0000ff00 #define ECONV_NEWLINE_DECORATOR_MASK 0x00003f00 +#define ECONV_NEWLINE_DECORATOR_READ_MASK 0x00000f00 +#define ECONV_NEWLINE_DECORATOR_WRITE_MASK 0x00003000 #define ECONV_UNIVERSAL_NEWLINE_DECORATOR 0x00000100 #define ECONV_CRLF_NEWLINE_DECORATOR 0x00001000 -- cgit v1.2.3