mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
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
This commit is contained in:
parent
9e4b24d4f3
commit
8101cc3de4
3 changed files with 26 additions and 5 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue