summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-29 09:10:20 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-29 09:10:20 +0000
commit5925c930a8120ac5033f513a22a891b0329b29b8 (patch)
tree8ccacb31c9736c1a35bf138f4b3e539c9a5588cc /io.c
parent979ba5fc702823b954f5f3aa12702821d7a6481e (diff)
merge revision(s) 52745: [Backport #11738]
* io.c (argf_getpartial): should not resize str if the second argument is not given. [ruby-core:71668] [Bug #11738] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@52788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/io.c b/io.c
index 542e909784..511ff2615a 100644
--- a/io.c
+++ b/io.c
@@ -11180,7 +11180,9 @@ argf_getpartial(int argc, VALUE *argv, VALUE argf, int nonblock)
}
if (!next_argv()) {
- rb_str_resize(str, 0);
+ if (!NIL_P(str)) {
+ rb_str_resize(str, 0);
+ }
rb_eof_error();
}
if (ARGF_GENERIC_INPUT_P()) {