diff options
| author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-29 16:30:02 +0000 |
|---|---|---|
| committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-29 16:30:02 +0000 |
| commit | 5cfd7e5d4faf0f0b6060ed89fbcd6532c70e0517 (patch) | |
| tree | 1df755720db4398cfd707909428f7298a54d683b | |
| parent | bcc6561df8e2fdf97bbcb7194e2e36f80183d6be (diff) | |
| download | ruby-5cfd7e5d4faf0f0b6060ed89fbcd6532c70e0517.tar.gz ruby-5cfd7e5d4faf0f0b6060ed89fbcd6532c70e0517.tar.xz ruby-5cfd7e5d4faf0f0b6060ed89fbcd6532c70e0517.zip | |
* 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/branches/ruby_1_9_1@20043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | string.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Thu Oct 30 01:24:55 2008 Yusuke Endoh <mame@tsg.ne.jp> + + * string.c (rb_str_cmp): fix condition which always returned true + because ENCODING_GET returns unsigned long. + Thu Oct 30 01:10:32 2008 Yusuke Endoh <mame@tsg.ne.jp> * test/ruby/test_array (test_permutation): add a test that replaces @@ -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; } |
