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 | bc5cded8bc2689ab524a0686768211a1edb2842b (patch) | |
| tree | 187b544b43b89f69b340aee69c4ba546c9111f91 | |
| parent | 8ccba0f93d8b9f70e7efa788f98f2b23d463bc3c (diff) | |
| download | ruby-bc5cded8bc2689ab524a0686768211a1edb2842b.tar.gz ruby-bc5cded8bc2689ab524a0686768211a1edb2842b.tar.xz ruby-bc5cded8bc2689ab524a0686768211a1edb2842b.zip | |
* io.c (rb_io_inspect): not need to raise IOError for closed stream. [ruby-talk:51871]
git-svn-id: http://svn.ruby-lang.org/repos/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 <nobu.nokada@softhome.net> + + * io.c (rb_io_inspect): not need to raise IOError. [ruby-talk:51871] + Sun Sep 29 18:30:24 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net> * 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); |
