aboutsummaryrefslogtreecommitdiffstats
path: root/ext/zlib
diff options
context:
space:
mode:
Diffstat (limited to 'ext/zlib')
-rw-r--r--ext/zlib/zlib.c3
1 files changed, 3 insertions, 0 deletions
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;