* 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:
nobu 2005-08-11 14:29:46 +00:00
Родитель cc88d93a0e
Коммит c06b78ca92
2 изменённых файлов: 9 добавлений и 10 удалений

Просмотреть файл

@ -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>
* 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>
* 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().
* ext/tk/lib/tk/canvas.rb: didn't check __item_ruby2val_optkeys().

Просмотреть файл

@ -382,10 +382,9 @@ strio_close(self)
VALUE self;
{
struct StringIO *ptr = StringIO(self);
if (CLOSED(ptr)) {
if (CLOSED(ptr) || !(ptr->flags & FMODE_READWRITE)) {
rb_raise(rb_eIOError, "closed stream");
}
ptr->string = Qnil;
ptr->flags &= ~FMODE_READWRITE;
return Qnil;
}
@ -405,9 +404,7 @@ strio_close_read(self)
if (!READABLE(ptr)) {
rb_raise(rb_eIOError, "closing non-duplex IO for reading");
}
if (!((ptr->flags &= ~FMODE_READABLE) & FMODE_READWRITE)) {
ptr->string = Qnil;
}
ptr->flags &= ~FMODE_READABLE;
return Qnil;
}
@ -426,9 +423,7 @@ strio_close_write(self)
if (!WRITABLE(ptr)) {
rb_raise(rb_eIOError, "closing non-duplex IO for writing");
}
if (!((ptr->flags &= ~FMODE_WRITABLE) & FMODE_READWRITE)) {
ptr->string = Qnil;
}
ptr->flags &= ~FMODE_WRITABLE;
return Qnil;
}