Fix dictionary text files parser failing on BOM marking (bug 5858, r=Nextra)

Former-commit-id: 096464e3d5
This commit is contained in:
Vincent Herbet 2013-08-16 18:50:56 +02:00
parent 784f91e441
commit 6139d52a39

View File

@ -393,6 +393,14 @@ int CLangMngr::MergeDefinitionFile(const char *file)
if ((buf[0] == ';') || (buf[0] == '/' && buf[1] == '/'))
continue;
/* Check for BOM markings, which is only relevant on the first line.
* Not worth it, but it could be moved out of the loop.
*/
if (line == 1 && (buf[0] == (char)0xEF && buf[1] == (char)0xBB && buf[2] == (char)0xBF))
{
buf.erase(0, 3);
}
if (buf[0] == '[' && buf.size() >= 3)
{
if (multiline)