summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-19 14:43:37 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-19 14:43:37 +0000
commita329b7734874989596f506542f055ec19b5b47df (patch)
treee7b6a2f4c6b7ec22595b20db408efcc9ebe459cd /string.c
parent3e212b0484bb1f7106b4466209a8f507e718a96b (diff)
* string.c (rb_str_rindex): comparison length should be based on
bytes, not characters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/string.c b/string.c
index 9a9de2e64b..3f348f2662 100644
--- a/string.c
+++ b/string.c
@@ -1569,6 +1569,7 @@ rb_str_rindex(VALUE str, VALUE sub, long pos)
sbeg = RSTRING_PTR(str);
e = RSTRING_END(str);
t = RSTRING_PTR(sub);
+ slen = RSTRING_LEN(sub);
for (;;) {
s = str_nth(sbeg, e, pos, enc, asc);
if (!s) return -1;