diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-30 07:20:28 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-30 07:20:28 +0000 |
commit | 79a85b18cc6ad27f1a70a703270680dc30a1263e (patch) | |
tree | 4fbfcaf67c80822fe2ea7b2de20a9c49304aa734 /test/-ext- | |
parent | bfc9c3766f3efd58002bd6e58074c16322abd852 (diff) |
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
Diffstat (limited to 'test/-ext-')
-rw-r--r-- | test/-ext-/string/test_cstr.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/-ext-/string/test_cstr.rb b/test/-ext-/string/test_cstr.rb index 35b5fe5931..2083016db2 100644 --- a/test/-ext-/string/test_cstr.rb +++ b/test/-ext-/string/test_cstr.rb @@ -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) |