diff options
| author | dranull <150595692+dranull@users.noreply.github.com> | 2023-12-09 18:27:30 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-09 18:27:30 +0000 |
| commit | 89d8f665b5c661a4b373f766692b3d68c3cd294f (patch) | |
| tree | a970a6fe6b63c28d47eb41ad34c8fdb255ba9c92 /src/config/ConfigManager.cpp | |
| parent | 9132660768668e1e14d95b8e8b3b02c4b000f137 (diff) | |
config: Avoid regenerating config if --config is used (#4103)
Diffstat (limited to 'src/config/ConfigManager.cpp')
| -rw-r--r-- | src/config/ConfigManager.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 28f3b746..71841804 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -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"); |
