From ecc1dedabbb91ef3a8b14983c48fcb1b49a9be42 Mon Sep 17 00:00:00 2001 From: knu Date: Sun, 8 Jun 2008 17:35:41 +0000 Subject: * ext/zlib/zlib.c (rb_deflate_init_copy): Copy buffers as well. [ruby-list:45018] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/zlib/zlib.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ext') diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 66616fb09f..c6c52b7454 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -1126,6 +1126,9 @@ rb_deflate_init_copy(VALUE self, VALUE orig) if (err != Z_OK) { raise_zlib_error(err, 0); } + z1->input = NIL_P(z2->input) ? Qnil : rb_str_dup(z2->input); + z1->buf = NIL_P(z2->buf) ? Qnil : rb_str_dup(z2->buf); + z1->buf_filled = z2->buf_filled; z1->flags = z2->flags; return self; -- cgit v1.2.3