* 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
This commit is contained in:
mame 2008-10-29 16:30:02 +00:00
parent 86a3914825
commit 6bacaabffd
2 changed files with 6 additions and 1 deletions

View file

@ -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;
}