From 24d4738c2258a2abca5a154f4a7997653bf67b7e Mon Sep 17 00:00:00 2001 From: crowning- Date: Sat, 28 Mar 2015 14:22:57 +0100 Subject: [PATCH] Create empty dash.conf during startup if it doesn't exist --- src/util.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) mode change 100644 => 100755 src/util.cpp diff --git a/src/util.cpp b/src/util.cpp old mode 100644 new mode 100755 index 9a5fc587a..dde07da31 --- a/src/util.cpp +++ b/src/util.cpp @@ -1106,8 +1106,13 @@ void ReadConfigFile(map& mapSettingsRet, map >& mapMultiSettingsRet) { boost::filesystem::ifstream streamConfig(GetConfigFile()); - if (!streamConfig.good()) - return; // No dash.conf file is OK + if (!streamConfig.good()){ + // Create empty dash.conf if it does not excist + FILE* configFile = fopen(GetConfigFile().string().c_str(), "a"); + if (configFile != NULL) + fclose(configFile); + return; // Nothing to read, so just return + } set setOptions; setOptions.insert("*");