From 29854466fa67b3f24f5674b32dc4aafb7a702204 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sun, 21 Feb 2010 00:53:55 +0000 Subject: [PATCH] check_bom should undo char, even if end of file (obs from Nicola di Mauro). --- C/iopreds.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/C/iopreds.c b/C/iopreds.c index f84e84088..ffd23023d 100755 --- a/C/iopreds.c +++ b/C/iopreds.c @@ -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: {