diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-18 03:47:15 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-18 03:47:15 +0000 |
| commit | 164ad361d894c2a3ce429c8789b4dd08d92fa87d (patch) | |
| tree | 4bf97a990961de36ff24aaef26be99b15cf8d0df | |
| parent | f2335b0f12fb7625058f09e6578a78469fc11e53 (diff) | |
| download | ruby-164ad361d894c2a3ce429c8789b4dd08d92fa87d.tar.gz ruby-164ad361d894c2a3ce429c8789b4dd08d92fa87d.tar.xz ruby-164ad361d894c2a3ce429c8789b4dd08d92fa87d.zip | |
* io.c (io_enc_str): code conversion removed.
(io_enc_str_converted): removed because it is identical to
io_enc_str now.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | io.c | 22 |
2 files changed, 8 insertions, 20 deletions
@@ -1,3 +1,9 @@ +Mon Aug 18 12:45:24 2008 Tanaka Akira <akr@fsij.org> + + * io.c (io_enc_str): code conversion removed. + (io_enc_str_converted): removed because it is identical to + io_enc_str now. + Mon Aug 18 12:12:29 2008 Tanaka Akira <akr@fsij.org> * io.c (io_shift_crbuf): add strp argument to append into existing @@ -1384,24 +1384,6 @@ static VALUE io_enc_str(VALUE str, rb_io_t *fptr) { OBJ_TAINT(str); - if (fptr->enc2) { - /* two encodings, so transcode from enc2 to enc */ - /* the methods in transcode.c are static, so call indirectly */ - str = rb_funcall(str, id_encode, 2, - rb_enc_from_encoding(fptr->enc), - rb_enc_from_encoding(fptr->enc2)); - } - else { - /* just one encoding, so associate it with the string */ - rb_enc_associate(str, io_read_encoding(fptr)); - } - return str; -} - -static VALUE -io_enc_str_converted(VALUE str, rb_io_t *fptr) -{ - OBJ_TAINT(str); rb_enc_associate(str, io_read_encoding(fptr)); return str; } @@ -1526,7 +1508,7 @@ read_all(rb_io_t *fptr, long siz, VALUE str) io_shift_crbuf(fptr, fptr->crbuf_len, &str); } if (more_char(fptr) == -1) { - return io_enc_str_converted(str, fptr); + return io_enc_str(str, fptr); } } } @@ -2147,7 +2129,7 @@ rb_io_getline_1(VALUE rs, long limit, VALUE io) } } if (!NIL_P(str)) - str = io_enc_str_converted(str, fptr); + str = io_enc_str(str, fptr); } if (!NIL_P(str)) { |
