diff --git a/ChangeLog b/ChangeLog index cc3d30f726..f33053f933 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Jun 7 23:47:35 2008 Akinori MUSHA + + * ext/zlib/zlib.c (rb_deflate_initialize, Init_zlib): Fix up + initialize_copy; [ruby-list:45016]. + Sat Jun 7 22:15:02 2008 Nobuyoshi Nakada * configure.in (VENDOR_DIR): use LIBDIR instead of PREFIX as well as diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index b971ea76db..b06ebe3fad 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -1116,10 +1116,12 @@ rb_deflate_initialize(int argc, VALUE *argv, VALUE obj) static VALUE rb_deflate_init_copy(VALUE self, VALUE orig) { - struct zstream *z1 = get_zstream(self); - struct zstream *z2 = get_zstream(orig); + struct zstream *z1, *z2; int err; + Data_Get_Struct(self, struct zstream, z1); + z2 = get_zstream(orig); + err = deflateCopy(&z1->stream, &z2->stream); if (err != Z_OK) { raise_zlib_error(err, 0); @@ -3267,7 +3269,7 @@ void Init_zlib() rb_define_singleton_method(cDeflate, "deflate", rb_deflate_s_deflate, -1); rb_define_alloc_func(cDeflate, rb_deflate_s_allocate); rb_define_method(cDeflate, "initialize", rb_deflate_initialize, -1); - rb_define_method(cDeflate, "initialize_copy", rb_deflate_init_copy, 0); + rb_define_method(cDeflate, "initialize_copy", rb_deflate_init_copy, 1); rb_define_method(cDeflate, "deflate", rb_deflate_deflate, -1); rb_define_method(cDeflate, "<<", rb_deflate_addstr, 1); rb_define_method(cDeflate, "flush", rb_deflate_flush, -1);