diff --git a/ChangeLog b/ChangeLog index 12b6527e22..f9487cf0f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ Tue Jan 9 03:54:38 2007 Yukihiro Matsumoto * 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 * thread.c (rb_thread_stop_timer_thread(), rb_thread_reset_timer_thread(), diff --git a/string.c b/string.c index 49eddf6148..8046145178 100644 --- a/string.c +++ b/string.c @@ -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; }