--gBBFr7Ir9EOA20Yy
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On 2003-06-23 07:20:13 +0900, D T wrote:
> Is this normal?

No, I think this is a bug. I've made a patch (-> Attachement) that
hopefully fixes it.

-- 
The problems of business administration in general and data base
management in particular are much too difficult for people that think in
IBMerese, compounded with sloppy English.
  -- Edsger Dijkstra, How do we tell truths that might hurt?

--gBBFr7Ir9EOA20Yy
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="ruby-string.patch"

Index: string.c
RCS file: /src/ruby/string.c,v
retrieving revision 1.156
diff -u -p -r1.156 string.c
--- string.c	26 May 2003 08:22:28 -0000	1.156
+++ string.c	22 Jun 2003 23:13:25 -0000
@@ -1142,12 +1142,16 @@ rb_str_upto(beg, end, excl)
     VALUE beg, end;
     int excl;
 {
-    VALUE current;
+    VALUE current, after_end;
     ID succ  b_intern("succ");
 
     StringValue(end);
+    if (rb_str_cmp(beg, end) > 0) {
+	rb_raise(rb_eArgError, "begin string greater than end string");
+    }
+    after_end  b_funcall(end, succ, 0, 0);
     current  eg;
-    while (rb_str_cmp(current, end) < ) {
+    while (!rb_str_equal(current, after_end)) {
 	rb_yield(current);
 	if (!excl && rb_str_equal(current, end)) break;
 	current  b_funcall(current, succ, 0, 0);

--gBBFr7Ir9EOA20Yy--