From 8ea276d9bd3ebf1b57c3de1854cb6626d134aeda Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Wed, 1 Jan 2025 22:15:34 -0500 Subject: [PATCH] not set --- launcher/src/CmderLauncher.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index b0e8c91..cc1c3ea 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -289,8 +289,12 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr // Set path to Cmder user ConEmu config file PathCombine(userCfgPath, userConfigDirPath, L"user-ConEmu.xml"); } + + // Check if the user has specified a config file to use + // If cpuCfgPath is set and exists, use it. + // If userCfgPath is set and exists, use it. - if (wcscmp(cpuCfgPath, L"") == 0 && (PathFileExists(cpuCfgPath) || use_user_cfg == false)) // config/ConEmu-%COMPUTERNAME%.xml file exists or /m was specified on command line, use machine specific config. + if (wcscmp(cpuCfgPath, L"") != 0 && (PathFileExists(cpuCfgPath) || use_user_cfg == false)) // config/ConEmu-%COMPUTERNAME%.xml file exists or /m was specified on command line, use machine specific config. { if (cfgRoot.length() == 0) // '/c [path]' was NOT specified { @@ -335,7 +339,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr } } } - else if (wcscmp(userCfgPath, L"") == 0 && PathFileExists(userCfgPath)) // config/user_conemu.xml exists, use it. + else if (wcscmp(userCfgPath, L"") != 0 && PathFileExists(userCfgPath)) // config/user_conemu.xml exists, use it. { if (cfgRoot.length() == 0) // '/c [path]' was NOT specified { @@ -439,7 +443,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr exit(1); } } - else if (wcscmp(cfgPath, L"") == 0 && PathFileExists(cfgPath)) // vendor/conemu-maximus5/ConEmu.xml exists, copy vendor/conemu-maximus5/ConEmu.xml to config/user_conemu.xml + else if (wcscmp(cfgPath, L"") != 0 && PathFileExists(cfgPath)) // vendor/conemu-maximus5/ConEmu.xml exists, copy vendor/conemu-maximus5/ConEmu.xml to config/user_conemu.xml { if (!CopyFile(cfgPath, userCfgPath, FALSE)) { @@ -462,7 +466,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr PathCombine(userConEmuCfgPath, userConfigDirPath, L"user-ConEmu.xml"); } - else if (wcscmp(defaultCfgPath, L"") == 0) // '/c [path]' was specified and 'vendor/ConEmu.xml.default' config exists, copy Cmder 'vendor/ConEmu.xml.default' file to '[user specified path]/config/user_ConEmu.xml'. + else if (wcscmp(defaultCfgPath, L"") != 0) // '/c [path]' was specified and 'vendor/ConEmu.xml.default' config exists, copy Cmder 'vendor/ConEmu.xml.default' file to '[user specified path]/config/user_ConEmu.xml'. { if ( ! CopyFile(defaultCfgPath, userCfgPath, FALSE)) {