Skip to content

Commit

Permalink
* io.c (read_all, rb_io_getline_fast): encoding is rb_input_encoding.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nurse committed Mar 1, 2008
1 parent 840723e commit 4c7d380
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Sat Mar 01 10:31:19 2008 NARUSE, Yui <[email protected]>

* io.c (read_all, rb_io_getline_fast): encoding is rb_input_encoding.

Sat Mar 1 10:09:40 2008 Nobuyoshi Nakada <[email protected]>

* string.c (tr_setup_table, rb_str_split_m, rb_str_chomp_bang):
Expand Down
10 changes: 5 additions & 5 deletions io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1359,8 +1359,8 @@ read_all(rb_io_t *fptr, long siz, VALUE str)
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)) {
Expand Down Expand Up @@ -1802,8 +1802,8 @@ rb_io_getline_fast(rb_io_t *fptr)
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);
Expand Down Expand Up @@ -1839,7 +1839,7 @@ rb_io_getline_fast(rb_io_t *fptr)
}

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;
Expand Down

0 comments on commit 4c7d380

Please sign in to comment.