ruby-changes:10171
From: nobu <ko1@a...>
Date: Wed, 21 Jan 2009 15:31:46 +0900 (JST)
Subject: [ruby-changes:10171] Ruby:r21715 (trunk): * io.c (rb_io_ungetbyte, rb_io_ungetc): clears EOF flag.
nobu 2009-01-21 15:31:03 +0900 (Wed, 21 Jan 2009) New Revision: 21715 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21715 Log: * io.c (rb_io_ungetbyte, rb_io_ungetc): clears EOF flag. Modified files: trunk/ChangeLog trunk/io.c Index: ChangeLog =================================================================== --- ChangeLog (revision 21714) +++ ChangeLog (revision 21715) @@ -1,3 +1,7 @@ +Wed Jan 21 15:32:15 2009 Nobuyoshi Nakada <nobu@r...> + + * io.c (rb_io_ungetbyte, rb_io_ungetc): clears EOF flag. + Wed Jan 21 14:41:48 2009 NAKAMURA Usaku <usa@r...> * array.c (take_items): to_ary() raises ArgumentError if cannot to Index: io.c =================================================================== --- io.c (revision 21714) +++ io.c (revision 21715) @@ -354,7 +354,8 @@ } #define io_set_eof(fptr) (void)(((fptr)->mode & FMODE_TTY) && ((fptr)->mode |= FMODE_EOF)) -#define io_seek(fptr, ofs, whence) (fptr->mode &= ~FMODE_EOF, lseek(flush_before_seek(fptr)->fd, ofs, whence)) +#define io_unset_eof(fptr) (fptr->mode &= ~FMODE_EOF) +#define io_seek(fptr, ofs, whence) (io_unset_eof(fptr), lseek(flush_before_seek(fptr)->fd, ofs, whence)) #define io_tell(fptr) lseek(flush_before_seek(fptr)->fd, 0, SEEK_CUR) #ifndef SEEK_CUR @@ -2868,6 +2869,7 @@ SafeStringValue(b); } io_ungetbyte(b, fptr); + io_unset_eof(fptr); return Qnil; } @@ -2924,6 +2926,7 @@ else { io_ungetbyte(c, fptr); } + io_unset_eof(fptr); return Qnil; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/