summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-09 02:35:38 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-09 02:35:38 +0000
commit646e2efaef83f789632260bc88a154506c9b25af (patch)
treef1e2c6527ecbc8672484f2dd334af18ff425ed90 /io.c
parent70f76601969f7e8b5bfb3bfd5d83e5d32c5c3e41 (diff)
* 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/trunk@22146 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 9cac7631c4..6f0b9d034f 100644
--- a/io.c
+++ b/io.c
@@ -7024,6 +7024,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);