summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--string.c5
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 3da882eabb..a7b4163850 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Fri Feb 21 12:45:50 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * string.c (rb_str_cmp_m): two small bugs fixed.
+
Fri Feb 21 08:03:09 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* gc.c (rb_gc_mark): inline rb_gc_mark_children().
diff --git a/string.c b/string.c
index 7a21e5c8eb..acdfe40434 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 {