summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--array.c5
-rw-r--r--string.c6
3 files changed, 20 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 055e3d9004..b2585a4628 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
+Tue Apr 7 18:50:16 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * experimental release 1.1b9_08.
+
+Tue Apr 7 18:31:27 1998 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>
+
+ * instruby.rb (mandir): dll installation for cygwin32
+
Tue Apr 7 01:16:45 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
+ * config.sub (maybe_os): TOWNS support?
+
+ * config.guess: too strict check for libc versions on linuxes.
+
* experimental release 1.1b9_07.
* array.c (ary_cmp): compare each element using `<=>'.
diff --git a/array.c b/array.c
index 5093163986..626d83cab5 100644
--- a/array.c
+++ b/array.c
@@ -1078,7 +1078,10 @@ ary_cmp(ary, ary2)
return v;
}
}
- return INT2FIX(0);
+ len = RARRAY(ary)->len - RARRAY(ary2)->len;
+ if (len == 0) return INT2FIX(0);
+ if (len > 0) return INT2FIX(1);
+ return INT2FIX(-1);
}
static VALUE
diff --git a/string.c b/string.c
index 17f31b085d..1d3cdadc7c 100644
--- a/string.c
+++ b/string.c
@@ -482,9 +482,11 @@ str_cmp(str1, str2)
len = min(RSTRING(str1)->len, RSTRING(str2)->len);
retval = memcmp(RSTRING(str1)->ptr, RSTRING(str2)->ptr, len);
if (retval == 0) {
- return RSTRING(str1)->ptr[len] - RSTRING(str2)->ptr[len];
+ retval = RSTRING(str1)->ptr[len] - RSTRING(str2)->ptr[len];
}
- return retval;
+ if (retval == 0) return 0;
+ if (retval > 0) return 1;
+ return -1;
}
static VALUE