summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-27 04:13:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-27 04:13:54 +0000
commitab9c982cc0299435a795000d68eb9472d8ecfde0 (patch)
treedcc891fa639942f22127f5f027604931556efc9c /string.c
parent9052a8cd948840068c8a6a51850f421fff11c887 (diff)
* string.c (str_new_empty): should copy also the encoding as an
empty substring. [ruby-dev:45441][Bug #6206] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35146 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 7d865d669a..e16b4291d8 100644
--- a/string.c
+++ b/string.c
@@ -726,6 +726,7 @@ static VALUE
str_new_empty(VALUE str)
{
VALUE v = rb_str_new5(str, 0, 0);
+ rb_enc_copy(v, str);
OBJ_INFECT(v, str);
return v;
}