* ext/stringio/stringio.c: keep holding string after closed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cc88d93a0e
commit
c06b78ca92
@ -1,3 +1,7 @@
|
|||||||
|
Thu Aug 11 23:29:03 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/stringio/stringio.c: keep holding string after closed.
|
||||||
|
|
||||||
Thu Aug 11 13:01:48 2005 Kouhei Sutou <kou@cozmixng.org>
|
Thu Aug 11 13:01:48 2005 Kouhei Sutou <kou@cozmixng.org>
|
||||||
|
|
||||||
* lib/rss: fixed sort bug. [ruby-list:41018]
|
* lib/rss: fixed sort bug. [ruby-list:41018]
|
||||||
@ -46,9 +50,9 @@ Wed Aug 10 10:38:50 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
|
|||||||
|
|
||||||
Wed Aug 10 10:29:40 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
Wed Aug 10 10:29:40 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||||
|
|
||||||
* ext/tk/lib/tk.rb: fix bug on handling __ruby2val_optkeys().
|
* ext/tk/lib/tk.rb: fix bug on handling __ruby2val_optkeys().
|
||||||
|
|
||||||
* ext/tk/lib/tk/itemconfig.rb: fix bug on handling
|
* ext/tk/lib/tk/itemconfig.rb: fix bug on handling
|
||||||
__item_ruby2val_optkeys().
|
__item_ruby2val_optkeys().
|
||||||
|
|
||||||
* ext/tk/lib/tk/canvas.rb: didn't check __item_ruby2val_optkeys().
|
* ext/tk/lib/tk/canvas.rb: didn't check __item_ruby2val_optkeys().
|
||||||
|
@ -382,10 +382,9 @@ strio_close(self)
|
|||||||
VALUE self;
|
VALUE self;
|
||||||
{
|
{
|
||||||
struct StringIO *ptr = StringIO(self);
|
struct StringIO *ptr = StringIO(self);
|
||||||
if (CLOSED(ptr)) {
|
if (CLOSED(ptr) || !(ptr->flags & FMODE_READWRITE)) {
|
||||||
rb_raise(rb_eIOError, "closed stream");
|
rb_raise(rb_eIOError, "closed stream");
|
||||||
}
|
}
|
||||||
ptr->string = Qnil;
|
|
||||||
ptr->flags &= ~FMODE_READWRITE;
|
ptr->flags &= ~FMODE_READWRITE;
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
@ -405,9 +404,7 @@ strio_close_read(self)
|
|||||||
if (!READABLE(ptr)) {
|
if (!READABLE(ptr)) {
|
||||||
rb_raise(rb_eIOError, "closing non-duplex IO for reading");
|
rb_raise(rb_eIOError, "closing non-duplex IO for reading");
|
||||||
}
|
}
|
||||||
if (!((ptr->flags &= ~FMODE_READABLE) & FMODE_READWRITE)) {
|
ptr->flags &= ~FMODE_READABLE;
|
||||||
ptr->string = Qnil;
|
|
||||||
}
|
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -426,9 +423,7 @@ strio_close_write(self)
|
|||||||
if (!WRITABLE(ptr)) {
|
if (!WRITABLE(ptr)) {
|
||||||
rb_raise(rb_eIOError, "closing non-duplex IO for writing");
|
rb_raise(rb_eIOError, "closing non-duplex IO for writing");
|
||||||
}
|
}
|
||||||
if (!((ptr->flags &= ~FMODE_WRITABLE) & FMODE_READWRITE)) {
|
ptr->flags &= ~FMODE_WRITABLE;
|
||||||
ptr->string = Qnil;
|
|
||||||
}
|
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user