diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-25 01:57:48 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-25 01:57:48 +0000 |
commit | cf7d61b774514636dcaf786913183935732fbba7 (patch) | |
tree | 474d3da0b385314074c2cccdadd108f7764c7c9c /io.c | |
parent | f7023dcacacd736d051b1b4c0fb328ca74a7b7e9 (diff) | |
download | ruby-cf7d61b774514636dcaf786913183935732fbba7.tar.gz |
* 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/trunk@52745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -11247,7 +11247,9 @@ argf_getpartial(int argc, VALUE *argv, VALUE argf, VALUE opts, 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()) { |