mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 05:25:34 +02:00
string.c: return reallocated pointer
* string.c (str_fill_term): return new pointer reallocated by filling terminator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
bfc9c3766f
commit
79a85b18cc
4 changed files with 36 additions and 1 deletions
|
@ -18,6 +18,12 @@ class Test_StringCStr < Test::Unit::TestCase
|
|||
assert_equal(0, s.cstr_term, Bug4319)
|
||||
end
|
||||
|
||||
def test_shared
|
||||
s = Bug::String.new("abcdef")*5
|
||||
s = s.unterminated_substring(0, 29)
|
||||
assert_equal(0, s.cstr_term, Bug4319)
|
||||
end
|
||||
|
||||
def test_frozen
|
||||
s0 = Bug::String.new("abcdefgh"*8)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue