summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-22 09:48:57 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-22 09:48:57 +0000
commit59c5bb7ea7c9a991fe63ff71953087ccc41c7861 (patch)
tree21e538fb198aef91a8693cccceea96a8390419f3
parent0db129f6a638e32f7885aa53253d20aff465e7a3 (diff)
merges r22146 from trunk into ruby_1_9_1.
* io.c (io_encoding_set): ignore second argument when external and internal are same. [ruby-dev:37939] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@22523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--io.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 58d0bbb0d..57b881c38 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Feb 9 11:31:09 2009 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (io_encoding_set): ignore second argument when external and
+ internal are same. [ruby-dev:37939]
+
Sun Feb 8 23:28:05 2009 Yusuke Endoh <mame@tsg.ne.jp>
* include/ruby/st.h, st.c: order entries by a linked list instead of
diff --git a/io.c b/io.c
index 5a91e04c6..80482bf5f 100644
--- a/io.c
+++ b/io.c
@@ -6969,6 +6969,10 @@ io_encoding_set(rb_io_t *fptr, VALUE v1, VALUE v2, VALUE opt)
}
else
enc = rb_to_encoding(v2);
+ if (enc == enc2) {
+ /* Special case - "-" => no transcoding */
+ enc2 = NULL;
+ }
}
else
enc = rb_to_encoding(v2);