linux-dist: Clean up home dir detection

This commit is contained in:
Jan Holthuis 2015-08-11 21:31:57 +02:00
parent 6808bbba66
commit 60c827cf0c
1 changed files with 10 additions and 15 deletions

View File

@ -786,19 +786,16 @@ int main(int argc, wchar* argv[])
signal(SIGKILL, clean_exit);
#endif
#if defined(USES_HOMEDIR) && HOST_OS != OS_DARWIN && !defined(TARGET_EMSCRIPTEN)
string home = (string)getenv("HOME");
if(home.c_str())
{
home += "/.reicast";
mkdir(home.c_str(), 0755); // create the directory if missing
SetHomeDir(home);
}
else
SetHomeDir(".");
#else
SetHomeDir(".");
#endif
string home = ".";
#if defined(USES_HOMEDIR) && HOST_OS != OS_DARWIN && !defined(TARGET_EMSCRIPTEN)
if(getenv("HOME") != NULL)
{
home = (string)getenv("HOME") + "/.reicast";
mkdir(home.c_str(), 0755); // create the directory if missing
}
#endif
SetHomeDir(home);
printf("Home dir is: %s\n", GetPath("/").c_str());
#if defined(SUPPORT_X11)
x11_keymap[113] = DPad_Left;
@ -821,8 +818,6 @@ int main(int argc, wchar* argv[])
x11_keymap[36] = Btn_Start;
#endif
printf("Home dir is: %s\n",GetPath("/").c_str());
common_linux_setup();
SetupInput();