mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* string.c (rb_str_insert): should not add length in bytes to index in
chars. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5ee029f62c
commit
c26e32ec16
2 changed files with 8 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Mon Dec 10 16:52:17 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* string.c (rb_str_insert): should not add length in bytes to index in
|
||||||
|
chars.
|
||||||
|
|
||||||
Mon Dec 10 14:33:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Mon Dec 10 14:33:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* eval.c (rb_f_public_send): rename invoke_method to public_send.
|
* eval.c (rb_f_public_send): rename invoke_method to public_send.
|
||||||
|
|
2
string.c
2
string.c
|
@ -2247,7 +2247,7 @@ rb_str_insert(VALUE str, VALUE idx, VALUE str2)
|
||||||
long pos = NUM2LONG(idx);
|
long pos = NUM2LONG(idx);
|
||||||
|
|
||||||
if (pos == -1) {
|
if (pos == -1) {
|
||||||
pos = RSTRING_LEN(str);
|
return rb_str_append(str, str2);
|
||||||
}
|
}
|
||||||
else if (pos < 0) {
|
else if (pos < 0) {
|
||||||
pos++;
|
pos++;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue