From 370a635ee27e8643ef6663539550a433f20e0d66 Mon Sep 17 00:00:00 2001 From: Aiken Harris Date: Fri, 26 Sep 2025 17:36:12 +0200 Subject: [PATCH] Correctly handle CRLF line endings in config parser --- xtldr/config.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xtldr/config.cc b/xtldr/config.cc index b7e9445..3ae9b66 100644 --- a/xtldr/config.cc +++ b/xtldr/config.cc @@ -622,7 +622,7 @@ Configuration::ParseConfigFile(IN CONST PCHAR RawConfig, SectionName = InputData; /* Find end of the section name */ - while(*InputData != ']' && *InputData != '\0' && *InputData != '\n') + while(*InputData != ']' && *InputData != '\0' && *InputData != '\r' && *InputData != '\n') { /* Advance to the next character */ InputData++; @@ -672,7 +672,7 @@ Configuration::ParseConfigFile(IN CONST PCHAR RawConfig, Key = InputData; /* Find end of the key */ - while(*InputData != '=' && *InputData != '\0' && *InputData != '\n') + while(*InputData != '=' && *InputData != '\0' && *InputData != '\r' && *InputData != '\n') { /* Advance to the next character */ InputData++; @@ -700,7 +700,7 @@ Configuration::ParseConfigFile(IN CONST PCHAR RawConfig, Value = InputData; /* Find end of the value */ - while(*InputData != '\0' && *InputData != '\n') + while(*InputData != '\0' && *InputData != '\r' && *InputData != '\n') { /* Advance to the next character */ InputData++;