1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2002-09-30 11:31:28 +00:00
parent 443ed1783d
commit a7a8ea12da
2 changed files with 6 additions and 2 deletions

View file

@ -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> Sun Sep 29 18:30:24 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* win32/win32.c (rb_w32_open_osfhandle): adjust * win32/win32.c (rb_w32_open_osfhandle): adjust

4
io.c
View file

@ -555,8 +555,8 @@ rb_io_inspect(obj)
OpenFile *fptr; OpenFile *fptr;
char *buf, *cname; char *buf, *cname;
GetOpenFile(obj, fptr); fptr = RFILE(rb_io_taint_check(obj))->fptr;
if (!fptr->path) return rb_any_to_s(obj); if (!fptr || !(fptr->f || fptr->f2) || !fptr->path) return rb_any_to_s(obj);
cname = rb_class2name(CLASS_OF(obj)); cname = rb_class2name(CLASS_OF(obj));
buf = ALLOCA_N(char, strlen(cname) + strlen(fptr->path) + 5); buf = ALLOCA_N(char, strlen(cname) + strlen(fptr->path) + 5);
sprintf(buf, "#<%s:%s>", cname, fptr->path); sprintf(buf, "#<%s:%s>", cname, fptr->path);