summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-01-08 19:02:50 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-01-08 19:02:50 +0000
commit7ba0cd826e6fb6555bb5eb79bc84f8167294afe9 (patch)
tree9f8c227de74fef044b6127d0c4ba7b7a0877d659 /string.c
parentccb7ce612088ed56b28ec3f70eb14a39f38834ff (diff)
* string.c (rb_str_upto): String#upto from empty string makes
inifinite loop. [ruby-core:09864] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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;
}