diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-30 12:19:43 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-30 12:19:43 +0000 |
commit | 6602bc193b378f832e52f446df8804efafd5dfb8 (patch) | |
tree | 344bb18580b46ce9fdf18ce203aca0a44c96e98f /io.c | |
parent | 041afd1cfb337d1d056defa118281728185beb97 (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_1@52800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -10967,7 +10967,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()) { |