summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-13 08:03:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-13 08:03:31 +0000
commitaf69c730879ecd0ae4e63732d46522659c053b70 (patch)
tree1addf2920073b136576797f6c48ed9c1ebcf64f8
parent02501dbe9157f7d8d233157c494b7dfa01d93726 (diff)
* encoding.c (rb_enc_compatible): should swap encoding indexes too.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--encoding.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index b300317904..979a3c2626 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Dec 13 17:03:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * encoding.c (rb_enc_compatible): should swap encoding indexes too.
+
Thu Dec 13 16:41:37 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* encoding.c (rb_enc_compatible): should not judge compatibility
diff --git a/encoding.c b/encoding.c
index 94577a1b24..ef3b89d7bf 100644
--- a/encoding.c
+++ b/encoding.c
@@ -390,8 +390,11 @@ rb_enc_compatible(VALUE str1, VALUE str2)
}
if (BUILTIN_TYPE(str1) != T_STRING) {
VALUE tmp = str1;
+ int idx0 = idx1;
str1 = str2;
str2 = tmp;
+ idx1 = idx2;
+ idx2 = idx0;
}
if (BUILTIN_TYPE(str1) == T_STRING) {
int cr1, cr2;