From 92337bd30d01fbd163354ed85303b0ec7e92337e Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 28 Aug 2007 05:23:33 +0000 Subject: * string.c (rb_str_splice_0): should check to modify. [ruby-dev:31665] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 1 + 1 file changed, 1 insertion(+) (limited to 'string.c') diff --git a/string.c b/string.c index 4c6301f56..95d48289e 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); -- cgit