summaryrefslogtreecommitdiffstats
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
commit5e4169c288db67f9611a59826b56264e6f6f272b (patch)
tree9f8c227de74fef044b6127d0c4ba7b7a0877d659 /string.c
parent022f66736428e1ca86294da4c6bec9de2e4ed151 (diff)
downloadruby-5e4169c288db67f9611a59826b56264e6f6f272b.tar.gz
ruby-5e4169c288db67f9611a59826b56264e6f6f272b.tar.xz
ruby-5e4169c288db67f9611a59826b56264e6f6f272b.zip
* string.c (rb_str_upto): String#upto from empty string makes
inifinite loop. [ruby-core:09864] git-svn-id: http://svn.ruby-lang.org/repos/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 fb8afdbed..3261db61e 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;
}