From fbcf952dadad0492a087067166f1caaee5c2b0ef Mon Sep 17 00:00:00 2001 From: Rafal Kupiec Date: Mon, 18 Dec 2023 18:49:49 +0100 Subject: [PATCH] Remove leading and trialing quotes from config values --- xtldr2/config.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xtldr2/config.c b/xtldr2/config.c index dfc0c7b..0f5243f 100644 --- a/xtldr2/config.c +++ b/xtldr2/config.c @@ -451,6 +451,18 @@ BlpParseConfigFile(IN CONST PCHAR RawConfig, return Status; } + /* Remove leading quotes from the value */ + if(*Value == '"' || *Value == '\'') + { + Value++; + } + + /* Remove trailing quotes from the value */ + if(Value[ValueLength - 2] == '"' || Value[ValueLength - 2] == '\'') + { + Value[ValueLength - 2] = 0; + } + /* Initialize new option and add it to the list */ RtlStringToWideString(Option->Name, &Key, RtlStringLength(Key, 0) + 1); RtlStringToWideString(Option->Value, &Value, RtlStringLength(Value, 0) + 1);