diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-22 06:56:44 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-22 06:56:44 +0000 |
commit | 707f2fd26e3c0696a3904365329b479e4965a4c1 (patch) | |
tree | c4f1aeda488fec63302ed3fbd9e3ee5d92b9f3f7 | |
parent | 65a8185eb212639875ae8db14dfffb1fa06b71e9 (diff) | |
download | ruby-707f2fd26e3c0696a3904365329b479e4965a4c1.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | encoding.c | 1 |
2 files changed, 4 insertions, 0 deletions
@@ -12,6 +12,9 @@ Tue Jan 22 12:57:07 2008 Yukihiro Matsumoto <matz@ruby-lang.org> * 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 <nobu@ruby-lang.org> * 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; |