summaryrefslogtreecommitdiff
path: root/io.c
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
commit6ac1783d4b9c1b2d72018f38e08e7e154475876a (patch)
tree21e538fb198aef91a8693cccceea96a8390419f3 /io.c
parentbb8f8db502055183ab92b9bdc4ec30ddd8c52989 (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: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@22523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/io.c b/io.c
index 5a91e04c6a..80482bf5fa 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);