summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/zlib/zlib.c11
-rw-r--r--version.h2
3 files changed, 14 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 344265a9749..f47a29a9ba8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jun 27 17:38:21 2008 Akinori MUSHA <knu@iDaemons.org>
+
+ * ext/zlib/zlib.c (rb_deflate_initialize, Init_zlib): Fix up
+ initialize_copy; [ruby-list:45016], [ruby-list:45018].
+
Fri Jun 27 17:28:39 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* io.c (rb_open_file, rb_io_s_sysopen): fmode should be unsigned int.
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 1b895537724..d4c50289201 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -1182,14 +1182,19 @@ static VALUE
rb_deflate_init_copy(self, orig)
VALUE self, 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);
}
+ 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;
@@ -3371,7 +3376,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);
diff --git a/version.h b/version.h
index e209ede79fe..189d67d4f13 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-06-27"
#define RUBY_VERSION_CODE 186
#define RUBY_RELEASE_CODE 20080627
-#define RUBY_PATCHLEVEL 235
+#define RUBY_PATCHLEVEL 236
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8