ruby-changes:4129
From: ko1@a...
Date: Thu, 28 Feb 2008 05:56:21 +0900 (JST)
Subject: [ruby-changes:4129] naruse - Ruby:r15619 (trunk): * io.c (read_all): fix if.
naruse 2008-02-28 05:56:03 +0900 (Thu, 28 Feb 2008) New Revision: 15619 Modified files: trunk/io.c Log: * io.c (read_all): fix if. * io.c (rb_io_getline_1): move needless set encoding. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/io.c?r1=15619&r2=15618&diff_format=u Index: io.c =================================================================== --- io.c (revision 15618) +++ io.c (revision 15619) @@ -1384,7 +1384,7 @@ } if (bytes != siz) rb_str_resize(str, bytes); str = io_enc_str(str, fptr); - if (fptr->enc2) { + if (!fptr->enc2) { ENC_CODERANGE_SET(str, cr); } return str; @@ -1960,10 +1960,10 @@ swallow(fptr, '\n'); } } + str = io_enc_str(str, fptr); } if (!NIL_P(str)) { - str = io_enc_str(str, fptr); if (!nolimit) { fptr->lineno++; lineno = INT2FIX(fptr->lineno); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/