diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-09-30 11:31:28 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-09-30 11:31:28 +0000 |
commit | a7a8ea12dae2022de1d899998b6d076ce99bd940 (patch) | |
tree | 187b544b43b89f69b340aee69c4ba546c9111f91 | |
parent | 443ed1783dcfa6a35bf5947295417b339ff42058 (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
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | io.c | 4 |
2 files changed, 6 insertions, 2 deletions
@@ -1,3 +1,7 @@ +Mon Sep 30 20:29:10 2002 Nobuyoshi Nakada <[email protected]> + + * io.c (rb_io_inspect): not need to raise IOError. [ruby-talk:51871] + Sun Sep 29 18:30:24 2002 Nobuyoshi Nakada <[email protected]> * win32/win32.c (rb_w32_open_osfhandle): adjust @@ -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); |