* string.c (rb_str_index): wrong starting position.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5485df3e10
commit
1c32ff927f
@ -1,3 +1,7 @@
|
|||||||
|
Thu Dec 20 09:06:54 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* string.c (rb_str_index): wrong starting position.
|
||||||
|
|
||||||
Thu Dec 20 06:34:27 2007 Koichi Sasada <ko1@atdot.net>
|
Thu Dec 20 06:34:27 2007 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* compile.c (iseq_compile_each): add pop after throw as return.
|
* compile.c (iseq_compile_each): add pop after throw as return.
|
||||||
|
1
string.c
1
string.c
@ -1457,6 +1457,7 @@ rb_str_index(VALUE str, VALUE sub, long offset)
|
|||||||
s = RSTRING_PTR(str);
|
s = RSTRING_PTR(str);
|
||||||
if (offset) {
|
if (offset) {
|
||||||
offset = str_offset(s, RSTRING_END(str), offset, enc, IS_7BIT(str));
|
offset = str_offset(s, RSTRING_END(str), offset, enc, IS_7BIT(str));
|
||||||
|
s += offset;
|
||||||
}
|
}
|
||||||
if (slen == 0) return offset;
|
if (slen == 0) return offset;
|
||||||
/* need proceed one character at a time */
|
/* need proceed one character at a time */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user