diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-09-10 07:51:58 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-09-10 07:51:58 +0000 |
commit | 82abe79b9fa3b5a648f453076a28ed9566d02ec8 (patch) | |
tree | 38c67940337c200adc83b83669049492fb4a3534 /ext | |
parent | 4f77c495cddcdfcbb15e363ba21d09e5a9ddfd37 (diff) | |
download | ruby-82abe79b9fa3b5a648f453076a28ed9566d02ec8.tar.gz |
* class.c (rb_scan_args): Add support for optional keyword
argument hash.
* README.EXT, README.EXT.ja: Update documentation accordingly.
* dir.c (dir_initialize): Make use of the new rb_scan_args()
feature.
* io.c (rb_io_s_popen, rb_scan_open_args, rb_io_initialize)
(rb_io_s_pipe, open_key_args, io_s_foreach, io_s_readlines)
(rb_io_s_read, rb_io_set_encoding): Ditto.
* transcode.c (str_transcode, econv_args)
(econv_primitive_convert): Ditto.
* ext/zlib/zlib.c (rb_gzreader_initialize): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/zlib/zlib.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 20218a962c..970b85713e 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -3067,11 +3067,7 @@ rb_gzreader_initialize(int argc, VALUE *argv, VALUE obj) int err; Data_Get_Struct(obj, struct gzfile, gz); - if (argc > 1) { - opt = rb_check_convert_type(argv[argc-1], T_HASH, "Hash", "to_hash"); - if (!NIL_P(opt)) argc--; - } - rb_scan_args(argc, argv, "1", &io); + rb_scan_args(argc, argv, "1:", &io, &opt); /* this is undocumented feature of zlib */ err = inflateInit2(&gz->z.stream, -MAX_WBITS); |