aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--io.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index d5b1686840..d99df78d45 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/io.c b/io.c
index 7ae0a86335..0a4c21b225 100644
--- a/io.c
+++ b/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;