* io.c (argf_next_argv): wrong timing of setting ecflags.

fixed the failure of TestArgf#test_textmode introduced at r33662.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2011-11-16 02:36:08 +00:00
Родитель b4664c781b
Коммит bbe004c1e4
2 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Wed Nov 16 11:34:20 2011 NAKAMURA Usaku <usa@ruby-lang.org>
* io.c (argf_next_argv): wrong timing of setting ecflags.
fixed the failure of TestArgf#test_textmode introduced at r33662.
Wed Nov 16 10:45:00 2011 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/-test-/num2int/num2int.c: remove an unnecessary and wrong decl

6
io.c
Просмотреть файл

@ -7137,9 +7137,6 @@ argf_next_argv(VALUE argf)
fmode = FMODE_READABLE;
if (!ARGF.binmode) {
fmode |= DEFAULT_TEXTMODE;
#ifdef TEXTMODE_NEWLINE_DECORATOR_ON_WRITE
fptr->encs.ecflags |= TEXTMODE_NEWLINE_DECORATOR_ON_WRITE;
#endif
}
ARGF.current_file = prep_io(fr, fmode, rb_cFile, fn);
if (!NIL_P(write_io)) {
@ -7156,6 +7153,9 @@ argf_next_argv(VALUE argf)
fptr->encs.ecflags &= ~ECONV_NEWLINE_DECORATOR_MASK;
if (!ARGF.binmode) {
fptr->encs.ecflags |= ECONV_DEFAULT_NEWLINE_DECORATOR;
#ifdef TEXTMODE_NEWLINE_DECORATOR_ON_WRITE
fptr->encs.ecflags |= TEXTMODE_NEWLINE_DECORATOR_ON_WRITE;
#endif
}
}
ARGF.next_p = 0;