aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-09 01:04:29 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-09 01:04:29 +0000
commit8f9fb1a82077d89bd107d02b456e86ed991d4c6e (patch)
tree465e8f513fbf25d2b75bf8faf5697050017ef21b /string.c
parent998113d62f43a7052028105a1bc301d0af513d87 (diff)
downloadruby-8f9fb1a82077d89bd107d02b456e86ed991d4c6e.tar.gz
* 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
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 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)) {