diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-03 09:35:55 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-03 09:35:55 +0000 |
commit | d6d24991bdd894f92681960117aaf0393866434b (patch) | |
tree | 665867e7e9f64101c182584035b07f17a1922f61 | |
parent | 10354c7b5c5d09b2b059fe96c072938145247c5b (diff) | |
download | ruby-d6d24991bdd894f92681960117aaf0393866434b.tar.gz |
* ext/zlib/zlib.c (gzfile_reader_get_unused): use rb_str_new_shared
because gz->z.input is hidden string. [ruby-core:35057]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | ext/zlib/zlib.c | 2 |
2 files changed, 8 insertions, 2 deletions
@@ -1,6 +1,12 @@ +Thu Feb 3 18:33:26 2011 NARUSE, Yui <naruse@ruby-lang.org> + + * ext/zlib/zlib.c (gzfile_reader_get_unused): use rb_str_new_shared + because gz->z.input is hidden string. [ruby-core:35057] + Thu Feb 3 16:34:10 2011 NARUSE, Yui <naruse@ruby-lang.org> - * enc/shift_jis.c (code_to_mbc): cast as int from the subtraction of pointers. + * enc/shift_jis.c (code_to_mbc): cast as int from the subtraction of + pointers. * enc/utf_16le.c (utf16le_mbc_enc_len): use ptrdiff_t. diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index f119a17bf6..43448818d3 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -2471,7 +2471,7 @@ gzfile_reader_get_unused(struct gzfile *gz) } if (NIL_P(gz->z.input)) return Qnil; - str = rb_str_dup(gz->z.input); + str = rb_str_new_shared(gz->z.input); OBJ_TAINT(str); /* for safe */ return str; } |