Skip to content

Commit c1ed3fb

Browse files
author
evan82
committed
Merge pull request #285 from crowning-/v0.11.2.x
Create empty dash.conf during startup if it doesn't exist
2 parents 0202a96 + 24d4738 commit c1ed3fb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/util.cpp

100644100755
+7-2
Original file line numberDiff line numberDiff line change
@@ -1106,8 +1106,13 @@ void ReadConfigFile(map<string, string>& mapSettingsRet,
11061106
map<string, vector<string> >& mapMultiSettingsRet)
11071107
{
11081108
boost::filesystem::ifstream streamConfig(GetConfigFile());
1109-
if (!streamConfig.good())
1110-
return; // No dash.conf file is OK
1109+
if (!streamConfig.good()){
1110+
// Create empty dash.conf if it does not excist
1111+
FILE* configFile = fopen(GetConfigFile().string().c_str(), "a");
1112+
if (configFile != NULL)
1113+
fclose(configFile);
1114+
return; // Nothing to read, so just return
1115+
}
11111116

11121117
set<string> setOptions;
11131118
setOptions.insert("*");

0 commit comments

Comments
 (0)