diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-01-31 21:39:00 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-01-31 21:39:00 +0000 |
commit | 0470ce53c5f055a7c5e26f8e7c5ab753820c0950 (patch) | |
tree | ae3cb4ec8b8fcfda3865726863ea4b85c23a8d43 /io.c | |
parent | a42cc41ba1abacd37e1922965fae641e537a6b5f (diff) | |
download | ruby-0470ce53c5f055a7c5e26f8e7c5ab753820c0950.tar.gz |
* io.c (argf_close): skip stdin, which should be readable again.
[ruby-dev:45160] [Bug #5952]
* io.c (argf_readlines): reinitialize after all read to be
readable again.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -7276,6 +7276,7 @@ argf_forward(int argc, VALUE *argv, VALUE argf) static void argf_close(VALUE file) { + if (file == rb_stdin) return; if (RB_TYPE_P(file, T_FILE)) { rb_io_set_write_io(file, Qnil); } @@ -7691,6 +7692,7 @@ argf_readlines(int argc, VALUE *argv, VALUE argf) ARGF.lineno = lineno + RARRAY_LEN(ary); ARGF.last_lineno = ARGF.lineno; } + ARGF.init_p = 0; return ary; } |