Merge pull request #285 from crowning-/v0.11.2.x

Create empty dash.conf during startup if it doesn't exist
This commit is contained in:
evan82 2015-03-28 07:14:37 -07:00
commit c1ed3fb5fd

9
src/util.cpp Normal file → Executable file
View File

@ -1106,8 +1106,13 @@ void ReadConfigFile(map<string, string>& mapSettingsRet,
map<string, vector<string> >& mapMultiSettingsRet) map<string, vector<string> >& mapMultiSettingsRet)
{ {
boost::filesystem::ifstream streamConfig(GetConfigFile()); boost::filesystem::ifstream streamConfig(GetConfigFile());
if (!streamConfig.good()) if (!streamConfig.good()){
return; // No dash.conf file is OK // 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<string> setOptions; set<string> setOptions;
setOptions.insert("*"); setOptions.insert("*");