mirror of
https://github.com/sfall-team/sslc.git
synced 2026-07-27 16:52:49 -07:00
Changed code for skipping UTF-8 BOM
This commit is contained in:
@@ -524,19 +524,19 @@ int lex_internal(void) {
|
|||||||
top:
|
top:
|
||||||
c = getChar();
|
c = getChar();
|
||||||
|
|
||||||
// skip UTF-8 BOM
|
#ifndef BUILDING_DLL
|
||||||
if (c == 0xEF && stream->lineno == 1 && stream->column == 2) {
|
// skip UTF-8 BOM marker
|
||||||
stream->column--;
|
if (c == 0xEF) {
|
||||||
c = getChar();
|
c = getChar();
|
||||||
if (c == 0xBB) {
|
if (c == 0xBB) {
|
||||||
c = getChar();
|
c = getChar();
|
||||||
stream->column--;
|
|
||||||
}
|
|
||||||
if (c == 0xBF) {
|
if (c == 0xBF) {
|
||||||
c = getChar();
|
stream->column -= 3;
|
||||||
stream->column--;
|
goto top;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
switch(c) {
|
switch(c) {
|
||||||
case EOF:
|
case EOF:
|
||||||
|
|||||||
Reference in New Issue
Block a user