ruby-changes:7264
From: akr <ko1@a...>
Date: Sat, 23 Aug 2008 10:14:45 +0900 (JST)
Subject: [ruby-changes:7264] Ruby:r18783 (trunk): * io.c (read_all): fptr->enc2 is 0 if no conversion.
akr 2008-08-23 10:14:33 +0900 (Sat, 23 Aug 2008) New Revision: 18783 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18783 Log: * io.c (read_all): fptr->enc2 is 0 if no conversion. (rb_io_getline_fast): ditto. (io_getc): ditto. Modified files: trunk/ChangeLog trunk/io.c Index: ChangeLog =================================================================== --- ChangeLog (revision 18782) +++ ChangeLog (revision 18783) @@ -1,3 +1,9 @@ +Sat Aug 23 10:13:00 2008 Tanaka Akira <akr@f...> + + * io.c (read_all): fptr->enc2 is 0 if no conversion. + (rb_io_getline_fast): ditto. + (io_getc): ditto. + Sat Aug 23 09:45:35 2008 Tanaka Akira <akr@f...> * include/ruby/io.h (rb_io_t): remove path field and add pathv field. Index: io.c =================================================================== --- io.c (revision 18782) +++ io.c (revision 18783) @@ -1564,7 +1564,7 @@ pos = 0; enc = io_read_encoding(fptr); - cr = fptr->enc2 ? ENC_CODERANGE_BROKEN : 0; + cr = 0; if (siz == 0) siz = BUFSIZ; if (NIL_P(str)) { @@ -1588,9 +1588,7 @@ } if (bytes != siz) rb_str_resize(str, bytes); str = io_enc_str(str, fptr); - if (!fptr->enc2) { - ENC_CODERANGE_SET(str, cr); - } + ENC_CODERANGE_SET(str, cr); return str; } @@ -2008,7 +2006,7 @@ VALUE str = Qnil; int len = 0; long pos = 0; - int cr = fptr->enc2 ? ENC_CODERANGE_BROKEN : 0; + int cr = 0; for (;;) { long pending = READ_DATA_PENDING_COUNT(fptr); @@ -2044,7 +2042,7 @@ } str = io_enc_str(str, fptr); - if (!fptr->enc2) ENC_CODERANGE_SET(str, cr); + ENC_CODERANGE_SET(str, cr); fptr->lineno++; ARGF.lineno = INT2FIX(fptr->lineno); return str; @@ -2516,9 +2514,7 @@ } if (!cr) cr = ENC_CODERANGE_BROKEN; str = io_enc_str(str, fptr); - if (!fptr->enc2) { - ENC_CODERANGE_SET(str, cr); - } + ENC_CODERANGE_SET(str, cr); return str; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/