Allow HOME to be undefined, as on Windows.
This commit is contained in:
parent
67ca0689c9
commit
fdae459948
1 changed files with 6 additions and 4 deletions
|
@ -1744,10 +1744,12 @@ void Options::init(int argc, char **argv, const SGPath& appDataPath)
|
|||
|
||||
// then config files
|
||||
SGPath config;
|
||||
|
||||
std::string homedir(getenv("HOME"));
|
||||
std::string homedir;
|
||||
if (getenv("HOME")) {
|
||||
homedir = getenv("HOME");
|
||||
}
|
||||
|
||||
if( homedir.size() && hostname.size() ) {
|
||||
if( !homedir.empty() && !hostname.empty() ) {
|
||||
// Check for ~/.fgfsrc.hostname
|
||||
config.set(homedir);
|
||||
config.append(".fgfsrc");
|
||||
|
@ -1757,7 +1759,7 @@ void Options::init(int argc, char **argv, const SGPath& appDataPath)
|
|||
}
|
||||
|
||||
// Check for ~/.fgfsrc
|
||||
if( homedir.size() ) {
|
||||
if( !homedir.empty() ) {
|
||||
config.set(homedir);
|
||||
config.append(".fgfsrc");
|
||||
readConfig(config);
|
||||
|
|
Loading…
Reference in a new issue