summaryrefslogtreecommitdiffstats
path: root/ext/zlib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-21 14:14:13 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-21 14:14:13 +0000
commit8db0a59d921144bc73a385d664246f4b8bd2985e (patch)
treef39da42c5b6371821cedfa3d5a3916f3a5c5ac9d /ext/zlib
parent35dbae3628fedd9c29818742c824dd7a4361ab88 (diff)
downloadruby-8db0a59d921144bc73a385d664246f4b8bd2985e.tar.gz
ruby-8db0a59d921144bc73a385d664246f4b8bd2985e.tar.xz
ruby-8db0a59d921144bc73a385d664246f4b8bd2985e.zip
* ext/stringio/stringio.c (strio_write): should convert writing
string to the encoding of the buffer. * hash.c (rb_any_hash): typo fixed. * ext/zlib/zlib.c (rb_gzwriter_write): oops, IO string conversion need to be done by to_s. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/zlib')
-rw-r--r--ext/zlib/zlib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index bc0716b83..d2bcf76eb 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -2747,7 +2747,8 @@ rb_gzwriter_write(VALUE obj, VALUE str)
{
struct gzfile *gz = get_gzfile(obj);
- StringValue(str);
+ if (TYPE(str) != T_STRING)
+ str = rb_obj_as_string(str);
if (gz->enc2 && gz->enc2 != rb_ascii8bit_encoding()) {
str = rb_str_conv_enc(str, rb_enc_get(str), gz->enc2);
}