summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-29 02:44:29 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-29 02:44:29 +0000
commit1d18ec7ea69739b9bb9b5059b1dfdd36c3643d68 (patch)
treea67aa57171a1487105eda4314d237749ec9cebbc /io.c
parent151087a834908676c9d1366f43df12af46540fc5 (diff)
merge revision(s) 23700:
* io.c (argf_close): always call #close method. [ruby-core:23853] * io.c (argf_skip): should close only when current_file is available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@24312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/io.c b/io.c
index 8b0e51b460..3799c1b622 100644
--- a/io.c
+++ b/io.c
@@ -4484,10 +4484,7 @@ static void
argf_close(file)
VALUE file;
{
- if (TYPE(file) == T_FILE)
- rb_io_close(file);
- else
- rb_funcall3(file, rb_intern("close"), 0, 0);
+ rb_funcall3(file, rb_intern("close"), 0, 0);
}
static int
@@ -5735,7 +5732,7 @@ argf_binmode()
static VALUE
argf_skip()
{
- if (next_p != -1) {
+ if (init_p && next_p == 0) {
argf_close(current_file);
next_p = 1;
}