mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* io.c (validate_enc_binmode, prep_stdio): default to text mode on
dosish platforms. [ruby-core:38822] [Bug #5164] * transcode.c (rb_econv_prepare_options): keep default ecflags unchanged if no options. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
45fffaeac8
commit
7dc7da3d86
3 changed files with 12 additions and 3 deletions
|
@ -1,3 +1,11 @@
|
|||
Fri Sep 2 21:11:16 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* io.c (validate_enc_binmode, prep_stdio): default to text mode on
|
||||
dosish platforms. [ruby-core:38822] [Bug #5164]
|
||||
|
||||
* transcode.c (rb_econv_prepare_options): keep default ecflags
|
||||
unchanged if no options.
|
||||
|
||||
Fri Sep 2 14:36:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* vm_insnhelper.c (vm_search_const_defined_class): search
|
||||
|
|
5
io.c
5
io.c
|
@ -4435,7 +4435,7 @@ validate_enc_binmode(int *fmode_p, int ecflags, rb_encoding *enc, rb_encoding *e
|
|||
rb_raise(rb_eArgError, "ASCII incompatible encoding needs binmode");
|
||||
|
||||
if (!(fmode & FMODE_BINMODE) &&
|
||||
(ecflags & ECONV_NEWLINE_DECORATOR_MASK)) {
|
||||
(DEFAULT_TEXTMODE || (ecflags & ECONV_NEWLINE_DECORATOR_MASK))) {
|
||||
fmode |= DEFAULT_TEXTMODE;
|
||||
*fmode_p = fmode;
|
||||
}
|
||||
|
@ -6412,9 +6412,10 @@ static VALUE
|
|||
prep_stdio(FILE *f, int fmode, VALUE klass, const char *path)
|
||||
{
|
||||
rb_io_t *fptr;
|
||||
VALUE io = prep_io(fileno(f), fmode|FMODE_PREP, klass, path);
|
||||
VALUE io = prep_io(fileno(f), fmode|FMODE_PREP|DEFAULT_TEXTMODE, klass, path);
|
||||
|
||||
GetOpenFile(io, fptr);
|
||||
fptr->encs.ecflags |= ECONV_DEFAULT_NEWLINE_DECORATOR;
|
||||
fptr->stdio_file = f;
|
||||
|
||||
return io;
|
||||
|
|
|
@ -2533,7 +2533,7 @@ rb_econv_prepare_options(VALUE opthash, VALUE *opts, int ecflags)
|
|||
|
||||
if (NIL_P(opthash)) {
|
||||
*opts = Qnil;
|
||||
return 0;
|
||||
return ecflags;
|
||||
}
|
||||
ecflags = econv_opts(opthash, ecflags);
|
||||
|
||||
|
|
Loading…
Reference in a new issue