summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index fb8afdbeda..3261db61ed 100644
--- a/string.c
+++ b/string.c
@@ -1463,7 +1463,7 @@ rb_str_upto(beg, end, excl)
StringValue(current);
if (excl && rb_str_equal(current, end)) break;
StringValue(current);
- if (RSTRING(current)->len > RSTRING(end)->len)
+ if (RSTRING(current)->len > RSTRING(end)->len || RSTRING(current)->len == 0)
break;
}