summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--io.c2
-rw-r--r--test/ruby/test_io.rb11
-rw-r--r--version.h2
4 files changed, 19 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index f21f6536ad..64c6285abb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Feb 25 18:12:00 2016 Eric Wong <e@80x24.org>
+
+ * io.c (io_getpartial): remove unused kwarg from template
+ * test/ruby/test_io.rb (test_readpartial_bad_args): new
+ [Bug #11885]
+
Thu Feb 25 17:51:35 2016 Tadashi Saito <tadashi_saito@dwango.co.jp>
* compile.c, cont.c, doc, man: fix common misspelling.
diff --git a/io.c b/io.c
index 086fc358e3..8c60128e0f 100644
--- a/io.c
+++ b/io.c
@@ -2419,7 +2419,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);
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 5d00f04ef5..d3ac0c5f01 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -2997,6 +2997,17 @@ End
t.kill
end
+ def test_readpartial_bad_args
+ IO.pipe do |r, w|
+ w.write '.'
+ buf = String.new
+ assert_raise(ArgumentError) { r.readpartial(1, buf, exception: false) }
+ assert_raise(TypeError) { r.readpartial(1, exception: false) }
+ assert_equal [[r],[],[]], IO.select([r], nil, nil, 1)
+ assert_equal '.', r.readpartial(1)
+ end
+ end
+
def test_sysread_unlocktmp_ensure
bug8669 = '[ruby-core:56121] [Bug #8669]'
diff --git a/version.h b/version.h
index 75db0943a9..69aa2eb7b3 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.1.9"
#define RUBY_RELEASE_DATE "2016-02-25"
-#define RUBY_PATCHLEVEL 447
+#define RUBY_PATCHLEVEL 448
#define RUBY_RELEASE_YEAR 2016
#define RUBY_RELEASE_MONTH 2