mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* string.c (rb_str_rindex): comparison length should be based on
bytes, not characters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3e212b0484
commit
a329b77348
2 changed files with 4 additions and 0 deletions
|
@ -8,6 +8,9 @@ Wed Dec 19 22:59:52 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* string.c (rb_str_chomp_bang): wrong adjust condition.
|
* string.c (rb_str_chomp_bang): wrong adjust condition.
|
||||||
|
|
||||||
|
* string.c (rb_str_rindex): comparison length should be based on
|
||||||
|
bytes, not characters.
|
||||||
|
|
||||||
Wed Dec 19 21:42:18 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Wed Dec 19 21:42:18 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* re.c (rb_reg_regsub): should set checked encoding.
|
* re.c (rb_reg_regsub): should set checked encoding.
|
||||||
|
|
1
string.c
1
string.c
|
@ -1569,6 +1569,7 @@ rb_str_rindex(VALUE str, VALUE sub, long pos)
|
||||||
sbeg = RSTRING_PTR(str);
|
sbeg = RSTRING_PTR(str);
|
||||||
e = RSTRING_END(str);
|
e = RSTRING_END(str);
|
||||||
t = RSTRING_PTR(sub);
|
t = RSTRING_PTR(sub);
|
||||||
|
slen = RSTRING_LEN(sub);
|
||||||
for (;;) {
|
for (;;) {
|
||||||
s = str_nth(sbeg, e, pos, enc, asc);
|
s = str_nth(sbeg, e, pos, enc, asc);
|
||||||
if (!s) return -1;
|
if (!s) return -1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue