From ab9c982cc0299435a795000d68eb9472d8ecfde0 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 27 Mar 2012 04:13:54 +0000 Subject: * 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 --- string.c | 1 + 1 file changed, 1 insertion(+) (limited to 'string.c') 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; } -- cgit v1.2.3