diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-19 14:43:37 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-19 14:43:37 +0000 |
| commit | ecf4c497daed750bc71f2990a94d20bbcefab97b (patch) | |
| tree | e7b6a2f4c6b7ec22595b20db408efcc9ebe459cd /string.c | |
| parent | 53850d93570368fbfbce743be9104810e2ed5cd3 (diff) | |
| download | ruby-ecf4c497daed750bc71f2990a94d20bbcefab97b.tar.gz ruby-ecf4c497daed750bc71f2990a94d20bbcefab97b.tar.xz ruby-ecf4c497daed750bc71f2990a94d20bbcefab97b.zip | |
* 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
Diffstat (limited to 'string.c')
| -rw-r--r-- | string.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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; |
