diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-07 17:48:11 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-07 17:48:11 +0000 |
commit | add77a592bee645aa6787130db384afc11482a04 (patch) | |
tree | ab6fe0e36968c1048a5622691cfca98b1752ef02 /include | |
parent | 4764756497ace72f8578ab886ae1e8b45c2def7c (diff) | |
download | ruby-add77a592bee645aa6787130db384afc11482a04.tar.gz |
* 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
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/encoding.h | 2 |
1 files changed, 2 insertions, 0 deletions
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 |