From 8f9fb1a82077d89bd107d02b456e86ed991d4c6e Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 9 Feb 2008 01:04:29 +0000 Subject: [PATCH] * string.c (rb_str_new4): copy encoding from orig, instead of shared one. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ string.c | 1 + 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 94322d1762..0274117f0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Feb 9 10:03:07 2008 Tanaka Akira + + * string.c (rb_str_new4): copy encoding from orig, instead of shared + one. + Sat Feb 09 01:01:38 2008 NARUSE, Yui * file.c (lchmod_internal): fix warning cast from pointer to integer of diff --git a/string.c b/string.c index e24ca623dc..2bec884bef 100644 --- a/string.c +++ b/string.c @@ -425,6 +425,7 @@ rb_str_new4(VALUE orig) RSTRING(str)->as.heap.ptr += ofs; RSTRING(str)->as.heap.len -= ofs; } + rb_enc_copy(str, orig); OBJ_INFECT(str, orig); } else if (STR_EMBED_P(orig)) {