ruby-changes:4162
From: ko1@a...
Date: Sat, 1 Mar 2008 10:33:34 +0900 (JST)
Subject: [ruby-changes:4162] naruse - Ruby:r15652 (trunk): * io.c (read_all, rb_io_getline_fast): encoding is rb_input_encoding.
naruse 2008-03-01 10:33:17 +0900 (Sat, 01 Mar 2008)
New Revision: 15652
Modified files:
trunk/ChangeLog
trunk/io.c
Log:
* io.c (read_all, rb_io_getline_fast): encoding is rb_input_encoding.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15652&r2=15651&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/io.c?r1=15652&r2=15651&diff_format=u
Index: ChangeLog
===================================================================
--- ChangeLog (revision 15651)
+++ ChangeLog (revision 15652)
@@ -1,3 +1,7 @@
+Sat Mar 01 10:31:19 2008 NARUSE, Yui <naruse@r...>
+
+ * io.c (read_all, rb_io_getline_fast): encoding is rb_input_encoding.
+
Sat Mar 1 10:09:40 2008 Nobuyoshi Nakada <nobu@r...>
* string.c (tr_setup_table, rb_str_split_m, rb_str_chomp_bang):
Index: io.c
===================================================================
--- io.c (revision 15651)
+++ io.c (revision 15652)
@@ -1359,8 +1359,8 @@
long bytes = 0;
long n;
long pos = 0;
- rb_encoding *enc = io_read_encoding(fptr);
- int cr = 0;
+ rb_encoding *enc = io_input_encoding(fptr);
+ int cr = fptr->enc2 ? ENC_CODERANGE_BROKEN : 0;
if (siz == 0) siz = BUFSIZ;
if (NIL_P(str)) {
@@ -1802,8 +1802,8 @@
VALUE str = Qnil;
int len = 0;
long pos = 0;
- rb_encoding *enc = io_read_encoding(fptr);
- int cr = 0;
+ rb_encoding *enc = io_input_encoding(fptr);
+ int cr = fptr->enc2 ? ENC_CODERANGE_BROKEN : 0;
for (;;) {
long pending = READ_DATA_PENDING_COUNT(fptr);
@@ -1839,7 +1839,7 @@
}
str = io_enc_str(str, fptr);
- ENC_CODERANGE_SET(str, cr);
+ if (!fptr->enc2) ENC_CODERANGE_SET(str, cr);
fptr->lineno++;
lineno = INT2FIX(fptr->lineno);
return str;
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/