summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-21 09:16:06 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-21 09:16:06 +0000
commitb00a8195119a0e5ca20af8ea1122aa8b18e4ccb5 (patch)
tree0d5e25bd4834697e2db75b45f345ad8df5f9e242 /io.c
parent745dcf0915a0de05c1f4b8d167ce7bf8c214dfc2 (diff)
merges the latter half of r23699 and r23706 from trunk into ruby_1_9_1.
-- * io.c (argf_skip): should close only when current_file is available. -- * test/ruby/test_argf.rb (TestArgf#test_skip): updated test according to clarified behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@23790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index 477d1168ee..73ca7df3c1 100644
--- a/io.c
+++ b/io.c
@@ -8292,7 +8292,7 @@ argf_binmode_p(VALUE argf)
static VALUE
argf_skip(VALUE argf)
{
- if (ARGF.next_p != -1) {
+ if (ARGF.init_p && ARGF.next_p == 0) {
argf_close(ARGF.current_file);
ARGF.next_p = 1;
}