summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c4
1 files changed, 2 insertions, 2 deletions
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);