summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
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 9982e561b7..7d7eb5c769 100644
--- a/string.c
+++ b/string.c
@@ -1208,6 +1208,7 @@ rb_str_insert(str, idx, str2)
{
long pos = NUM2LONG(idx);
+ rb_str_modify(str);
if (pos == -1) {
pos = RSTRING(str)->len;
}