1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* string.c (rb_str_upto): use RSTRING_LEN().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2007-01-08 20:11:40 +00:00
parent af040cb612
commit 0143945146
2 changed files with 3 additions and 1 deletions

View file

@ -3,6 +3,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]
* string.c (rb_str_upto): use RSTRING_LEN().
Sun Jan 7 18:36:05 2007 Koichi Sasada <ko1@atdot.net>
* thread.c (rb_thread_stop_timer_thread(), rb_thread_reset_timer_thread(),

View file

@ -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) || RSTRING(current)->len == 0)
if (RSTRING_LEN(current) > RSTRING_LEN(end) || RSTRING_LEN(current) == 0)
break;
}