Import thelinx' freedesktop patch as in bug #105

This commit is contained in:
Bart van Strien
2010-11-07 00:43:26 +01:00
parent 573d8b10a2
commit e3a5a6cd9f
2 changed files with 11 additions and 0 deletions
@@ -214,6 +214,16 @@ namespace physfs
appdata = udir;
}
return appdata.c_str();
#elif defined(LOVE_LINUX)
if(appdata.empty())
{
char * xdgdatahome = getenv("XDG_DATA_HOM");
if (!xdgdatahome)
appdata = getUserDirectory();
else
appdata = xdgdatahome;
}
return appdata.c_str();
#else
return getUserDirectory();
#endif
@@ -22,6 +22,7 @@
#define LOVE_FILESYSTEM_PHYSFS_FILESYSTEM_H
// STD
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>