diff options
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | io.c | 7 |
2 files changed, 8 insertions, 5 deletions
@@ -1,3 +1,9 @@ +Tue Jun 16 09:11:36 2009 Yukihiro Matsumoto <matz@ruby-lang.org> + + * io.c (argf_close): always call #close method. [ruby-core:23853] + + * io.c (argf_skip): should close only when current_file is available. + Thu Jun 11 17:49:33 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * ext/bigdecimal/bigdecimal.c (gfCheckVal): never used. @@ -4518,10 +4518,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 @@ -5769,7 +5766,7 @@ argf_binmode() static VALUE argf_skip() { - if (next_p != -1) { + if (init_p && next_p == 0) { argf_close(current_file); next_p = 1; } |
