summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--string.c3
-rw-r--r--test/ruby/test_m17n_comb.rb4
3 files changed, 9 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 3d2b5a6c05..f5610bf477 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Mon Oct 6 12:18:23 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * string.c (rb_str_comparable): string comparison should be
+ transitive. [ruby-dev:36484]
+
+ * test/ruby/test_m17n_comb.rb (TestM17NComb#test_str_eq): test
+ updated.
+
Mon Oct 6 09:00:58 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* test/bigdecimal/test_bigdecimal.rb (test_sqrt_bigdecimal): test
diff --git a/string.c b/string.c
index d1fe9db70e..8593633632 100644
--- a/string.c
+++ b/string.c
@@ -1938,7 +1938,6 @@ rb_str_comparable(VALUE str1, VALUE str2)
{
int idx1, idx2;
int rc1, rc2;
- int a8;
if (RSTRING_LEN(str1) == 0) return Qtrue;
if (RSTRING_LEN(str2) == 0) return Qtrue;
@@ -1956,8 +1955,6 @@ rb_str_comparable(VALUE str1, VALUE str2)
if (rb_enc_asciicompat(rb_enc_from_index(idx1)))
return Qtrue;
}
- a8 = rb_ascii8bit_encindex();
- if (idx1 == a8 || idx2 == a8) return Qtrue;
return Qfalse;
}
diff --git a/test/ruby/test_m17n_comb.rb b/test/ruby/test_m17n_comb.rb
index 05e45d23cf..b5208f44f1 100644
--- a/test/ruby/test_m17n_comb.rb
+++ b/test/ruby/test_m17n_comb.rb
@@ -320,9 +320,7 @@ class TestM17NComb < Test::Unit::TestCase
desc_eq = "#{encdump s1} == #{encdump s2}"
if a(s1) == a(s2) and
(s1.ascii_only? && s2.ascii_only? or
- s1.encoding == s2.encoding or
- s1.encoding == (enc = Encoding.find("ASCII-8BIT")) or
- s2.encoding == enc) then
+ s1.encoding == s2.encoding) then
assert(s1 == s2, desc_eq)
assert(!(s1 != s2))
assert_equal(0, s1 <=> s2)