diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-27 20:56:03 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-27 20:56:03 +0000 |
commit | 588bd8d2e3bbeab1e51ad96a232c490ffa0c1384 (patch) | |
tree | bad87eee598d0b70833d4c1e15422a72e60bd3cd | |
parent | 57a3925cc09f4d5fdc25f247d980f69e3aae33a3 (diff) | |
download | ruby-588bd8d2e3bbeab1e51ad96a232c490ffa0c1384.tar.gz ruby-588bd8d2e3bbeab1e51ad96a232c490ffa0c1384.tar.xz ruby-588bd8d2e3bbeab1e51ad96a232c490ffa0c1384.zip |
* io.c (read_all): fix if.
* io.c (rb_io_getline_1): move needless set encoding.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | io.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1384,7 +1384,7 @@ read_all(rb_io_t *fptr, long siz, VALUE str) } 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 @@ rb_io_getline_1(VALUE rs, long limit, VALUE io) 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); |