summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-01-08 20:11:40 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-01-08 20:11:40 +0000
commit8d7145a4eb80b9e92354f2fbb2e142b32d8eeafc (patch)
tree1fd2e9ce2635f14cbd6a4198fff210e80e779c1f
parent7bfed97aaaf2dd495de019b6c42a26f67a7ca8c5 (diff)
downloadruby-8d7145a4eb80b9e92354f2fbb2e142b32d8eeafc.tar.gz
ruby-8d7145a4eb80b9e92354f2fbb2e142b32d8eeafc.tar.xz
ruby-8d7145a4eb80b9e92354f2fbb2e142b32d8eeafc.zip
* string.c (rb_str_upto): use RSTRING_LEN().
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog2
-rw-r--r--string.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 12b6527e2..f9487cf0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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(),
diff --git a/string.c b/string.c
index 49eddf614..804614517 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;
}