From 1bd8510674f4dc32c4f49453f7737dbd61c8b50c Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 13 Dec 2007 08:03:31 +0000 Subject: * encoding.c (rb_enc_compatible): should swap encoding indexes too. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- encoding.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'encoding.c') diff --git a/encoding.c b/encoding.c index 94577a1b2..ef3b89d7b 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; -- cgit