summaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-02-21 03:52:27 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-02-21 03:52:27 +0000
commit3db91fb06b06fc3dad0451ae4851527bb101631d (patch)
treeb98e9e8c849f34223719ffbd953f613e5151b12b /string.c
parent9f0b1bde89d51a5f9e6e2eba274f4fd38e2c880b (diff)
downloadruby-3db91fb06b06fc3dad0451ae4851527bb101631d.tar.gz
ruby-3db91fb06b06fc3dad0451ae4851527bb101631d.tar.xz
ruby-3db91fb06b06fc3dad0451ae4851527bb101631d.zip
* string.c (rb_str_cmp_m): two small bugs fixed.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/string.c b/string.c
index 7a21e5c8e..acdfe4043 100644
--- a/string.c
+++ b/string.c
@@ -816,10 +816,11 @@ rb_str_cmp_m(str1, str2)
else {
VALUE tmp = rb_funcall(str2, rb_intern("<=>"), 1, str1);
+ if (NIL_P(tmp)) return Qnil;
if (!FIXNUM_P(tmp)) {
- return rb_funcall(LONG2FIX(0), '-', tmp);
+ return rb_funcall(LONG2FIX(0), '-', 1, tmp);
}
- result = FIX2LONG(tmp);
+ result = -FIX2LONG(tmp);
}
}
else {
OSZAR »