config: Avoid regenerating config if --config is used (#4103)

This commit is contained in:
dranull 2023-12-09 18:27:30 +00:00 committed by GitHub
parent 9132660768
commit 89d8f665b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -1610,10 +1610,16 @@ void CConfigManager::loadConfigLoadVars() {
ifs.open(mainConfigPath);
if (!ifs.good()) {
Debug::log(WARN, "Config reading error. Attempting to generate, backing up old one if exists");
ifs.close();
if (!g_pCompositor->explicitConfigPath.empty()) {
Debug::log(WARN, "Config reading error!");
parseError = "Broken config file! (Could not read)";
return;
}
Debug::log(WARN, "Config reading error. Attempting to generate, backing up old one if exists");
if (std::filesystem::exists(mainConfigPath))
std::filesystem::rename(mainConfigPath, mainConfigPath + ".backup");