// 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");
}
// Check for ~/.fgfsrc
- if( homedir.size() ) {
+ if( !homedir.empty() ) {
config.set(homedir);
config.append(".fgfsrc");
readConfig(config);