mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* string.c (rb_str_splice_0): should check to modify. [ruby-dev:31665]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
38b1f98a72
commit
53635dea12
2 changed files with 5 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
Tue Aug 28 14:23:31 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* string.c (rb_str_splice_0): should check to modify. [ruby-dev:31665]
|
||||
|
||||
Tue Aug 28 14:21:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (parser_prepare): set parser encode too when BOM exists.
|
||||
|
|
1
string.c
1
string.c
|
@ -1834,6 +1834,7 @@ rb_str_aref_m(int argc, VALUE *argv, VALUE str)
|
|||
static void
|
||||
rb_str_splice_0(VALUE str, long beg, long len, VALUE val)
|
||||
{
|
||||
rb_str_modify(str);
|
||||
if (len < RSTRING_LEN(val)) {
|
||||
/* expand string */
|
||||
RESIZE_CAPA(str, RSTRING_LEN(str) + RSTRING_LEN(val) - len + 1);
|
||||
|
|
Loading…
Add table
Reference in a new issue