Preprocessor: improved handling when file starts with 0xff or 0xfe that is not part of a BOM

This commit is contained in:
Daniel Marjamäki 2013-08-31 13:17:57 +02:00
parent 5e7791d847
commit ed58b63712
1 changed files with 2 additions and 0 deletions

View File

@ -167,6 +167,8 @@ std::string Preprocessor::read(std::istream &istr, const std::string &filename)
bom = ((unsigned int)istr.get() << 8);
if (istr.peek() >= 0xfe)
bom |= (unsigned int)istr.get();
else
bom = 0; // allowed boms are 0/0xfffe/0xfeff
}
if (_settings && _settings->terminated())