From a7a8ea12dae2022de1d899998b6d076ce99bd940 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 30 Sep 2002 11:31:28 +0000 Subject: * io.c (rb_io_inspect): not need to raise IOError for closed stream. [ruby-talk:51871] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index 80c12bc5b5..a10ff06dc3 100644 --- a/io.c +++ b/io.c @@ -555,8 +555,8 @@ rb_io_inspect(obj) OpenFile *fptr; char *buf, *cname; - GetOpenFile(obj, fptr); - if (!fptr->path) return rb_any_to_s(obj); + fptr = RFILE(rb_io_taint_check(obj))->fptr; + if (!fptr || !(fptr->f || fptr->f2) || !fptr->path) return rb_any_to_s(obj); cname = rb_class2name(CLASS_OF(obj)); buf = ALLOCA_N(char, strlen(cname) + strlen(fptr->path) + 5); sprintf(buf, "#<%s:%s>", cname, fptr->path); -- cgit v1.2.3