From 9e3d9a2a009d2a0281802a84e1c5cc1c887edc71 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 16 Sep 1999 09:40:33 +0000 Subject: 1.4.1 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index 94acc767fb..7bb9d09966 100644 --- a/string.c +++ b/string.c @@ -520,7 +520,7 @@ rb_str_match(x, y) reg = rb_reg_regcomp(y); start = rb_reg_search(reg, x, 0, 0); if (start == -1) { - return Qfalse; + return Qnil; } return INT2NUM(start); @@ -760,7 +760,7 @@ rb_str_upto(beg, end, excl) if (TYPE(end) != T_STRING) end = rb_str_to_str(end); current = beg; - for (;;) { + while (rb_str_cmp(current, end) <= 0) { rb_yield(current); if (!excl && rb_str_equal(current, end)) break; current = rb_str_succ(current); -- cgit v1.2.3