From 6310f23f2ee5758ba235beaed3c0281bc7e98b3a Mon Sep 17 00:00:00 2001 From: yugui Date: Sun, 21 Jun 2009 09:16:06 +0000 Subject: 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@23790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'io.c') diff --git a/io.c b/io.c index 477d1168e..73ca7df3c 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; } -- cgit