summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-13 17:30:54 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-13 17:30:54 +0000
commit423f7541698e0cd00b14cba48377b47c90899e1e (patch)
treecd0adf0f4ef26f1d329c0d569b52bdac384e7f0b
parentf73033ed63b11b9f4119290769a0ba5fe7bb38b5 (diff)
downloadruby-423f7541698e0cd00b14cba48377b47c90899e1e.tar.gz
ruby-423f7541698e0cd00b14cba48377b47c90899e1e.tar.xz
ruby-423f7541698e0cd00b14cba48377b47c90899e1e.zip
* encoding.c (rb_enc_compatible): 1st argument (typically the
receiver) would have higher priority in encoding detection. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--encoding.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9c238d4e5..18f6a2cb2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Dec 14 02:29:32 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * encoding.c (rb_enc_compatible): 1st argument (typically the
+ receiver) would have higher priority in encoding detection.
+
Fri Dec 14 02:05:42 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (rb_io_synchronized): should check if initialized.
diff --git a/encoding.c b/encoding.c
index f297983cc..324ff956e 100644
--- a/encoding.c
+++ b/encoding.c
@@ -399,7 +399,7 @@ rb_enc_compatible(VALUE str1, VALUE str2)
}
if (cr2 == ENC_CODERANGE_7BIT) {
if (idx1 == 0) return rb_enc_from_index(idx2);
- if (idx2 == 0) return rb_enc_from_index(idx1);
+ return rb_enc_from_index(idx1);
}
}
if (cr1 == ENC_CODERANGE_7BIT &&