[前][次][番号順一覧][スレッド一覧]

ruby-changes:12034

From: matz <ko1@a...>
Date: Tue, 16 Jun 2009 10:15:31 +0900 (JST)
Subject: [ruby-changes:12034] Ruby:r23700 (ruby_1_8): * io.c (argf_close): always call #close method.

matz	2009-06-16 10:15:19 +0900 (Tue, 16 Jun 2009)

  New Revision: 23700

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23700

  Log:
    * io.c (argf_close): always call #close method.  [ruby-core:23853]
    * io.c (argf_skip): should close only when current_file is available.

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/io.c

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 23699)
+++ ruby_1_8/ChangeLog	(revision 23700)
@@ -1,3 +1,9 @@
+Tue Jun 16 09:11:36 2009  Yukihiro Matsumoto  <matz@r...>
+
+	* 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@r...>
 
 	* ext/bigdecimal/bigdecimal.c (gfCheckVal): never used.
Index: ruby_1_8/io.c
===================================================================
--- ruby_1_8/io.c	(revision 23699)
+++ ruby_1_8/io.c	(revision 23700)
@@ -4518,10 +4518,7 @@
 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 @@
 static VALUE
 argf_skip()
 {
-    if (next_p != -1) {
+    if (init_p && next_p == 0) {
 	argf_close(current_file);
 	next_p = 1;
     }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]