mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* io.c (rb_io_ungetbyte, rb_io_ungetc): clears EOF flag.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c5dea4c69d
commit
237c54075a
2 changed files with 8 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
Wed Jan 21 15:32:15 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* io.c (rb_io_ungetbyte, rb_io_ungetc): clears EOF flag.
|
||||
|
||||
Wed Jan 21 14:41:48 2009 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* array.c (take_items): to_ary() raises ArgumentError if cannot to
|
||||
|
|
5
io.c
5
io.c
|
@ -354,7 +354,8 @@ flush_before_seek(rb_io_t *fptr)
|
|||
}
|
||||
|
||||
#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 @@ rb_io_ungetbyte(VALUE io, VALUE b)
|
|||
SafeStringValue(b);
|
||||
}
|
||||
io_ungetbyte(b, fptr);
|
||||
io_unset_eof(fptr);
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
|
@ -2924,6 +2926,7 @@ rb_io_ungetc(VALUE io, VALUE c)
|
|||
else {
|
||||
io_ungetbyte(c, fptr);
|
||||
}
|
||||
io_unset_eof(fptr);
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue