From ecf4c497daed750bc71f2990a94d20bbcefab97b Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 19 Dec 2007 14:43:37 +0000 Subject: * string.c (rb_str_rindex): comparison length should be based on bytes, not characters. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 1 + 1 file changed, 1 insertion(+) (limited to 'string.c') diff --git a/string.c b/string.c index 9a9de2e64..3f348f266 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; -- cgit