Fix a problem of 'z' option and shared string

This commit is contained in:
h2so5
2013-08-24 06:49:58 +09:00
parent aa099f7f7d
commit 23df879a81
2 changed files with 7 additions and 1 deletions
+1
View File
@@ -62,6 +62,7 @@ mrb_str_modify(mrb_state *mrb, struct RString *s)
if (shared->refcnt == 1 && s->ptr == shared->ptr) {
s->ptr = shared->ptr;
s->aux.capa = shared->len;
s->ptr[s->len] = '\0';
mrb_free(mrb, shared);
}
else {