Ignore newlines in INI parser

This commit is contained in:
Jozef Nagy 2023-12-03 18:36:05 +01:00
parent cb7f4deb37
commit 36df83431b
No known key found for this signature in database
GPG Key ID: 5F72C3BF3BD614D8
2 changed files with 12 additions and 7 deletions

View File

@ -66,7 +66,7 @@ file(RELATIVE_PATH _PATH_PREFIX ${EXECTOS_BINARY_DIR} ${EXECTOS_SOURCE_DIR})
add_compiler_flags(-D__RELFILE__="&__FILE__[__FILE__[0] == '.' ? sizeof \\\"${_PATH_PREFIX}\\\" - 1 : sizeof XTOS_SOURCE_DIR]")
# Set the virtual disk image size (in MiB)
set_disk_image_size(128)
set_disk_image_size(16)
# Build all subprojects
add_subdirectory(bootdata)

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 */