check_bom should undo char, even if end of file (obs from Nicola di Mauro).

This commit is contained in:
Vitor Santos Costa 2010-02-21 00:53:55 +00:00
parent 7b89916c43
commit 29854466fa
1 changed files with 6 additions and 1 deletions

View File

@ -2164,8 +2164,13 @@ check_bom(int sno, StreamDesc *st)
int ch;
ch = st->stream_getc(sno);
if (ch == EOFCHAR)
if (ch == EOFCHAR) {
st->och = ch;
st->stream_getc = PlUnGetc;
st->stream_wgetc = get_wchar;
st->stream_gets = DefaultGets;
return TRUE;
}
switch(ch) {
case 0xFE:
{