mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-15 07:00:58 +00:00
Merge pull request #399 from shmerl/master
Support XDG base directory specification
This commit is contained in:
commit
6f36e42a43
1 changed files with 9 additions and 1 deletions
|
@ -104,7 +104,15 @@ const char* Sys_DefaultSavePath()
|
|||
SDL_free( base_path );
|
||||
}
|
||||
#else
|
||||
sprintf( savepath, "%s/.rbdoom3bfg", getenv( "HOME" ) );
|
||||
const char* xdg_data_home = getenv( "XDG_DATA_HOME" );
|
||||
if( xdg_data_home != NULL )
|
||||
{
|
||||
sprintf( savepath, "%s/rbdoom3bfg", xdg_data_home );
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf( savepath, "%s/.local/share/rbdoom3bfg", getenv( "HOME" ) );
|
||||
}
|
||||
#endif
|
||||
|
||||
return savepath.c_str();
|
||||
|
|
Loading…
Reference in a new issue