diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-09 18:51:46 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-09 18:51:46 +0000 |
commit | 95c04673589b3ceb9565d605bacf38320cb688aa (patch) | |
tree | fd0ae979c44725fea504d174fcd52aba25bdb71a /string.c | |
parent | ba164bcca3d038a0721cd9ab348d192e63da2b99 (diff) | |
download | ruby-95c04673589b3ceb9565d605bacf38320cb688aa.tar.gz ruby-95c04673589b3ceb9565d605bacf38320cb688aa.tar.xz ruby-95c04673589b3ceb9565d605bacf38320cb688aa.zip |
* string.c (rb_str_index): if t == s + pos, the character beginning
from s + pos is valid.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2074,7 +2074,7 @@ rb_str_index(VALUE str, VALUE sub, long offset) pos = rb_memsearch(sptr, slen, s, len); if (pos < 0) return pos; t = rb_enc_right_char_head(s, s+pos, enc); - if (t == s) break; + if (t == s + pos) break; if ((len -= t - s) <= 0) return -1; offset += t - s; s = t; |