From 3903f38c0ec5e611d7c13c5c958b71a5dc0d37fe Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Mon, 10 Oct 2022 00:41:29 +0200 Subject: [PATCH] GlosSITarget: fix reading config-files with spaces --- GlosSITarget/Settings.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/GlosSITarget/Settings.h b/GlosSITarget/Settings.h index 374b93a..a446f8a 100644 --- a/GlosSITarget/Settings.h +++ b/GlosSITarget/Settings.h @@ -126,20 +126,19 @@ inline void Parse(const std::vector& args) if (arg.empty()) { continue; } - if (arg[0] != L'-') { - configName = std::wstring(arg.begin(), arg.end()); - } - if (arg[0] == L'-') { - if (arg == L"-disableuwpoverlay") { - cli.no_uwp_overlay = true; - } - if (arg == L"-disablewatchdog") { - cli.disable_watchdog = true; - } + if (arg == L"-disableuwpoverlay") { + cli.no_uwp_overlay = true; + } else if (arg == L"-disablewatchdog") { + cli.disable_watchdog = true; + } else { + configName += L" " + std::wstring(arg.begin(), arg.end()); } + } - if (!configName.empty()) { + if (configName[0] == L' ') { + configName.erase(configName.begin()); + } if (!configName.ends_with(L".json")) { configName += L".json"; }