mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 14:25:38 +03:00
Fix dictionary text files parser failing on BOM marking (bug 5858, r=Nextra)
Former-commit-id: 096464e3d5
This commit is contained in:
parent
784f91e441
commit
6139d52a39
@ -393,6 +393,14 @@ int CLangMngr::MergeDefinitionFile(const char *file)
|
|||||||
if ((buf[0] == ';') || (buf[0] == '/' && buf[1] == '/'))
|
if ((buf[0] == ';') || (buf[0] == '/' && buf[1] == '/'))
|
||||||
continue;
|
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 (buf[0] == '[' && buf.size() >= 3)
|
||||||
{
|
{
|
||||||
if (multiline)
|
if (multiline)
|
||||||
|
Loading…
Reference in New Issue
Block a user