diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-01-08 18:58:31 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-01-08 18:58:31 +0000 |
commit | af040cb612f793ee86dacfadccdb1ad7fc4542db (patch) | |
tree | 5951c87fb312bf1cd198209496851fb1db039bec /string.c | |
parent | fe6e7164249767d1ee80ea461a01449b4e61bc1c (diff) | |
download | ruby-af040cb612f793ee86dacfadccdb1ad7fc4542db.tar.gz |
* 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/trunk@11513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1568,7 +1568,7 @@ rb_str_upto(VALUE beg, VALUE end, int excl) StringValue(current); if (excl && rb_str_equal(current, end)) break; StringValue(current); - if (RSTRING_LEN(current) > RSTRING_LEN(end)) + if (RSTRING_LEN(current) > RSTRING_LEN(end) || RSTRING(current)->len == 0) break; } |