summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-08 18:28:37 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-08 18:28:37 +0000
commite42543fb90625ec30d3df2698177f87aeb1b2033 (patch)
treed90c67ba7bffcae3ef8cf386353317aa514231bd
parent2e7693fbac686ab56fb13e3861d8ca4245cff113 (diff)
* ext/zlib/zlib.c (rb_deflate_initialize, Init_zlib): Fix up
initialize_copy; [ruby-list:45016], [ruby-list:45018]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@17033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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 451cd81..fe0c2cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Jun 9 03:28:05 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].
+
Mon Jun 9 03:26:03 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* NEWS: Mention new constants.
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 1b89553..d4c5028 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 71e661d..de2c397 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-06-09"
#define RUBY_VERSION_CODE 187
#define RUBY_RELEASE_CODE 20080609
-#define RUBY_PATCHLEVEL 15
+#define RUBY_PATCHLEVEL 16
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8