aboutsummaryrefslogtreecommitdiffstats
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 c5ef67a6c6..994e52d2ed 100644
--- a/string.c
+++ b/string.c
@@ -1551,6 +1551,7 @@ rb_str_init(int argc, VALUE *argv, VALUE str)
if (n == 1) {
memcpy(RSTRING(str)->as.heap.ptr, RSTRING_PTR(orig), len);
rb_enc_cr_str_exact_copy(str, orig);
+ FL_UNSET(str, STR_SHARED|STR_NOFREE);
}
FL_SET(str, STR_NOEMBED);
RSTRING(str)->as.heap.aux.capa = capa;