From 8101cc3de4a846f11b76be637c3260aaa73e0b3c Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 25 Jul 2015 02:05:34 +0000 Subject: string.c: fill the terminator * string.c (str_replace_shared_without_enc): fill the terminator of embedded strings in wide char encodings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/-ext-/string/test_cstr.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/-ext-/string/test_cstr.rb') diff --git a/test/-ext-/string/test_cstr.rb b/test/-ext-/string/test_cstr.rb index 1e973d0a39..7e24ec6a70 100644 --- a/test/-ext-/string/test_cstr.rb +++ b/test/-ext-/string/test_cstr.rb @@ -86,6 +86,14 @@ class Test_StringCStr < Test::Unit::TestCase } end + def test_wchar_replace + assert_wchars_term_char("abc") {|s| + w = s.dup + s.replace("abcdefghijklmnop") + s.replace(w) + } + end + def test_embedded_from_heap gh821 = "[GH-821]" embedded_string = "abcdefghi" -- cgit v1.2.1