summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-30 11:31:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-30 11:31:28 +0000
commita7a8ea12dae2022de1d899998b6d076ce99bd940 (patch)
tree187b544b43b89f69b340aee69c4ba546c9111f91 /io.c
parent443ed1783dcfa6a35bf5947295417b339ff42058 (diff)
* 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
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/io.c b/io.c
index 80c12bc..a10ff06 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);