diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-08 19:12:23 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-08 19:12:23 +0000 |
commit | 117fec74396341a72956bb0e3c5ed8c87614f7e5 (patch) | |
tree | 019fac0555e765c2084e58389d8f656f540058ac /io.c | |
parent | 0df86c0b0a47f566d6f5abada2af64d91dcb34fe (diff) |
merge revision(s) 53329: [Backport #11885]
* io.c (io_getpartial): remove unused kwarg from template
* test/ruby/test_io.rb (test_readpartial_bad_args): new
[Bug #11885]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@54041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -2483,7 +2483,7 @@ io_getpartial(int argc, VALUE *argv, VALUE io, int nonblock, int no_exception) long n, len; struct read_internal_arg arg; - rb_scan_args(argc, argv, "11:", &length, &str, NULL); + rb_scan_args(argc, argv, "11", &length, &str); if ((len = NUM2LONG(length)) < 0) { rb_raise(rb_eArgError, "negative length %ld given", len); @@ -2675,8 +2675,10 @@ io_read_nonblock(int argc, VALUE *argv, VALUE io) rb_scan_args(argc, argv, "11:", NULL, NULL, &opts); - if (!NIL_P(opts) && Qfalse == get_kwargs_exception(opts)) + if (!NIL_P(opts) && Qfalse == get_kwargs_exception(opts)) { no_exception = 1; + argc--; + } ret = io_getpartial(argc, argv, io, 1, no_exception); |