diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-29 02:20:23 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-29 02:20:23 +0000 |
commit | 7fc16c237724a5f4377cea47e3434f53d42af5f4 (patch) | |
tree | f617167d6c1cedde26b8ad9a083cbbb7f61717bd /string.c | |
parent | d2d37173e7803d6ceec22233a903eb26e0617151 (diff) | |
download | ruby-7fc16c237724a5f4377cea47e3434f53d42af5f4.tar.gz |
* encoding.c (rb_enc_compatible): ASCII compatible string and US-ASCII
regexp is compatible. [ruby-dev:36033]
* string.c (rb_str_index_m): second argument is position of character.
by usa. [ruby-dev:36033]
* string.c (rb_str_rindex_m): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -2167,6 +2167,9 @@ rb_str_index_m(int argc, VALUE *argv, VALUE str) } } + pos = str_offset(RSTRING_PTR(str), RSTRING_END(str), pos, + rb_enc_check(str, sub), single_byte_optimizable(str)); + switch (TYPE(sub)) { case T_REGEXP: pos = rb_reg_adjust_startpos(sub, str, pos, 0); @@ -2277,6 +2280,9 @@ rb_str_rindex_m(int argc, VALUE *argv, VALUE str) pos = len; } + pos = str_offset(RSTRING_PTR(str), RSTRING_END(str), pos, + rb_enc_check(str, sub), single_byte_optimizable(str)); + switch (TYPE(sub)) { case T_REGEXP: /* enc = rb_get_check(str, sub); */ |