summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-19 15:43:49 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-19 15:43:49 +0000
commit4a92946ee230bb0919aa14b52fded3d4285389fd (patch)
tree3c9a2229a544925e4b706a3850680fbdd8a30817
parent5101be8a5142d4f7acd0b4882deb4327f6da542b (diff)
* io.c (io_close): call rb_io_close() directly if io is a T_FILE
object. [ruby-dev:27156] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--io.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 33addaa..fdb39b3 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 2c2fa80..7b7a1a7 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);
}