Ignore newlines in INI parser

This commit is contained in:
Jozef Nagy
2023-12-03 18:36:05 +01:00
parent cb7f4deb37
commit 36df83431b
2 changed files with 12 additions and 7 deletions

View File

@@ -40,7 +40,17 @@ BlConfigParseIniFile(IN PWCHAR FileContents,
while(Argument != NULL)
{
/* Check every line */
if(RtlWideStringCompare(Argument, L"[", 1) == 0)
if(RtlWideStringCompare(Argument, L"\r\n", 2) == 0)
{
/* We can safely ignore a newline */
Argument += 2;
}
else if(RtlWideStringCompare(Argument, L"#", 1) == 0)
{
/* We can safely ignore a comment */
Argument += 1;
}
else if(RtlWideStringCompare(Argument, L"[", 1) == 0)
{
/* Skip to the section name */
Argument += 1;
@@ -95,11 +105,6 @@ BlConfigParseIniFile(IN PWCHAR FileContents,
/* Set a tune */
BlConsolePrint(L"Setting TUNE value to %S\n", Argument);
}
else if(RtlWideStringCompare(Argument, L"#", 1) == 0)
{
/* We can safely ignore a comment */
Argument += 1;
}
else
{
/* Configuration file might be corrupt */