summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--io.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 33addaaadb..fdb39b3a6d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Sep 20 00:34:07 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * io.c (io_close): call rb_io_close() directly if io is a T_FILE
+ object. [ruby-dev:27156]
+
Mon Sep 19 19:09:08 2005 Minero Aoki <aamine@loveruby.net>
* file.c (rb_file_chown): should accept nil. [ruby-dev:27171]
diff --git a/io.c b/io.c
index 2c2fa80f15..7b7a1a787e 100644
--- a/io.c
+++ b/io.c
@@ -2134,6 +2134,10 @@ static VALUE
io_close(io)
VALUE io;
{
+ if (TYPE(io) == T_FILE) {
+ rb_io_close(io);
+ return Qnil;
+ }
return rb_funcall(io, rb_intern("close"), 0, 0);
}