summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-19 16:01:06 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-19 16:01:06 +0000
commit7559d2fd7accfd9eab2c8ab5864a5c61d6016d1d (patch)
treee5b382e3e6dc23c0eef00a2da9fb50c0e2281495 /io.c
parent5363e91dba3d2bd1dffaf8eeff53bc3f0a2a3ce4 (diff)
* io.c (io_close): call rb_io_close() directly if io is a T_FILE
object. [ruby-dev:27156] * file.c (file_expand_path): allow pathnames to expand. [ruby-dev:27152] * numeric.c (Init_Numeric): should define Fixnum#div. [ruby-dev:27129] * file.c (rb_thread_flock): wrap flock(2) by TRAP_BEG and TRAP_END. [ruby-dev:27122] * file.c (rb_file_join): call FilePathValue() to all Pathnames to join. [ruby-dev:27127] * file.c (rb_get_path): call StringValueCStr() to ensure no nul bytes in path strings. * gc.c (garbage_collect): need value for return. [ruby-dev:27127] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/io.c b/io.c
index 04e46e085d..f3badc966a 100644
--- a/io.c
+++ b/io.c
@@ -2064,6 +2064,10 @@ rb_io_close_m(VALUE io)
static VALUE
io_close(VALUE io)
{
+ if (TYPE(io) == T_FILE) {
+ rb_io_close(io);
+ return Qnil;
+ }
return rb_funcall(io, rb_intern("close"), 0, 0);
}