summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-28 05:23:33 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-28 05:23:33 +0000
commit53635dea12e9459168b45647cf52e26e0f1d451b (patch)
tree96e5a60d24ac9fa06975d70770df90948d86d067 /string.c
parent38b1f98a72129983956d26162df6825046ccf5db (diff)
* 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
Diffstat (limited to 'string.c')
-rw-r--r--string.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/string.c b/string.c
index 4c6301f56b..95d48289eb 100644
--- a/string.c
+++ b/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);