From 707f2fd26e3c0696a3904365329b479e4965a4c1 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 22 Jan 2008 06:56:44 +0000 Subject: [PATCH] * encoding.c (rb_enc_compatible): wrong compatibility condition. [ruby-dev:33273] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 3 +++ encoding.c | 1 + 2 files changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 719fa74b1e..3b6feb777d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,9 @@ Tue Jan 22 12:57:07 2008 Yukihiro Matsumoto * encoding.c (rb_enc_compatible): encoding must be ASCII compatible before checking ENC_CODERANGE_7BIT. + * encoding.c (rb_enc_compatible): wrong compatibility condition. + [ruby-dev:33273] + Tue Jan 22 09:26:47 2008 Nobuyoshi Nakada * string.c (rb_str_each_char): iterates over a shadow. diff --git a/encoding.c b/encoding.c index f429f2c816..10e3b3a44c 100644 --- a/encoding.c +++ b/encoding.c @@ -669,6 +669,7 @@ rb_enc_compatible(VALUE str1, VALUE str2) if (cr1 != cr2) { /* may need to handle ENC_CODERANGE_BROKEN */ if (cr1 == ENC_CODERANGE_7BIT) return enc2; + if (cr2 == ENC_CODERANGE_7BIT) return enc1; } if (cr2 == ENC_CODERANGE_7BIT) { if (idx1 == 0) return enc2;