Skip to content
Snippets Groups Projects
Commit 1dd5493c authored by Houtan Bastani's avatar Houtan Bastani
Browse files

parallel: removed warning and clarified error message

parent c7e5b448
No related branches found
No related tags found
No related merge requests found
...@@ -73,26 +73,26 @@ ConfigFile::getConfigFileInfo(const string &parallel_config_file) ...@@ -73,26 +73,26 @@ ConfigFile::getConfigFileInfo(const string &parallel_config_file)
{ {
// Test OS and try to open default file // Test OS and try to open default file
#if defined(_WIN32) || defined(__CYGWIN32__) #if defined(_WIN32) || defined(__CYGWIN32__)
string defaultConfigFile (getenv("APPDATA")); if (getenv("APPDATA")==NULL)
if (&defaultConfigFile==NULL)
{ {
cerr << "ERROR: APPDATA environment variable not found." << endl; cerr << "ERROR: APPDATA environment variable not found." << endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
string defaultConfigFile (getenv("APPDATA"));
defaultConfigFile += "\\dynare.ini"; defaultConfigFile += "\\dynare.ini";
#else #else
string defaultConfigFile (getenv("HOME")); if (getenv("HOME")==NULL)
if (&defaultConfigFile==NULL)
{ {
cerr << "ERROR: HOME environment variable not found." << endl; cerr << "ERROR: HOME environment variable not found." << endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
string defaultConfigFile (getenv("HOME"));
defaultConfigFile += "/.dynare"; defaultConfigFile += "/.dynare";
#endif #endif
configFile = new ifstream(defaultConfigFile.c_str(), fstream::in); configFile = new ifstream(defaultConfigFile.c_str(), fstream::in);
if (!configFile->is_open()) if (!configFile->is_open())
{ {
cerr << "ERROR: Could not open the default config file" << endl; cerr << "ERROR: Could not open the default config file (" << defaultConfigFile << ")" << endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment