From e4961d1fa924a6441ce7d41fc81438eb5476b90d Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 19 Sep 2005 15:43:49 +0000 Subject: * io.c (io_close): call rb_io_close() directly if io is a T_FILE object. [ruby-dev:27156] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ io.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 33addaaad..fdb39b3a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Sep 20 00:34:07 2005 Yukihiro Matsumoto + + * 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 * file.c (rb_file_chown): should accept nil. [ruby-dev:27171] diff --git a/io.c b/io.c index 2c2fa80f1..7b7a1a787 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); } -- cgit