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 | 7bfed97aaaf2dd495de019b6c42a26f67a7ca8c5 (patch) | |
tree | 5951c87fb312bf1cd198209496851fb1db039bec | |
parent | 27bdbebab78c069e7e768d63d0517de697be67e1 (diff) | |
download | ruby-7bfed97aaaf2dd495de019b6c42a26f67a7ca8c5.tar.gz ruby-7bfed97aaaf2dd495de019b6c42a26f67a7ca8c5.tar.xz ruby-7bfed97aaaf2dd495de019b6c42a26f67a7ca8c5.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/trunk@11513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | string.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Tue Jan 9 03:54:38 2007 Yukihiro Matsumoto <matz@ruby-lang.org> + + * string.c (rb_str_upto): String#upto from empty string makes + inifinite loop. [ruby-core:09864] + Sun Jan 7 18:36:05 2007 Koichi Sasada <ko1@atdot.net> * thread.c (rb_thread_stop_timer_thread(), rb_thread_reset_timer_thread(), @@ -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; } |