summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-18 03:47:15 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-18 03:47:15 +0000
commit08dcd122354a9f9f86208ea71820fdd1721e64ac (patch)
tree4bf97a990961de36ff24aaef26be99b15cf8d0df
parent6f1fe004f7090b4ae6defbe10340b3edbee3bcb0 (diff)
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@18686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--io.c22
2 files changed, 8 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index e19f398466..0544d916f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/io.c b/io.c
index 45cd8049a1..bfd7afda12 100644
--- a/io.c
+++ b/io.c
@@ -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)) {