summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-29 16:30:02 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-29 16:30:02 +0000
commit6bacaabffd1e3ae004a9fee1f607d6782bc1d730 (patch)
tree5605dee930e114afc17b6f27f316e6aa951e71bd /string.c
parent86a391482556377a563a55f3a04ff38b3ea36e01 (diff)
* string.c (rb_str_cmp): fix condition which always returned true
because ENCODING_GET returns unsigned long. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index 16382b5304..ea7b04f335 100644
--- a/string.c
+++ b/string.c
@@ -2073,7 +2073,7 @@ rb_str_cmp(VALUE str1, VALUE str2)
if (retval == 0) {
if (RSTRING_LEN(str1) == RSTRING_LEN(str2)) {
if (!rb_str_comparable(str1, str2)) {
- if (ENCODING_GET(str1) - ENCODING_GET(str2) > 0)
+ if (ENCODING_GET(str1) > ENCODING_GET(str2))
return 1;
return -1;
}