From 86966fdda3444542e874bb43ea9135427832c179 Mon Sep 17 00:00:00 2001 From: mame Date: Wed, 29 Oct 2008 16:30:02 +0000 Subject: * string.c (rb_str_cmp): fix condition which always returned true because ENCODING_GET returns unsigned long. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'string.c') diff --git a/string.c b/string.c index 16382b530..ea7b04f33 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; } -- cgit