diff --git a/ChangeLog b/ChangeLog index 2eb2cbecd3..cf5930520e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Oct 8 19:32:56 2005 Nobuyoshi Nakada + + * io.c (rb_io_init_copy): clear PREP flag for copied IO. + fixed: [ruby-dev:27371] + Sat Oct 8 19:15:02 2005 Nobuyoshi Nakada * parse.y (rb_parser_malloc, rb_parser_free): manage parser stack on diff --git a/io.c b/io.c index 56727b790a..c7bb72cbd6 100644 --- a/io.c +++ b/io.c @@ -3433,7 +3433,7 @@ rb_io_init_copy(VALUE dest, VALUE io) rb_io_flush(io); /* copy OpenFile structure */ - fptr->mode = orig->mode; + fptr->mode = orig->mode & ~FMODE_PREP; fptr->pid = orig->pid; fptr->lineno = orig->lineno; if (orig->path) fptr->path = strdup(orig->path);