Browse Source

Import thelinx' freedesktop patch as in bug #105

Bart van Strien 14 years ago
parent
commit
e3a5a6cd9f

+ 10 - 0
src/modules/filesystem/physfs/Filesystem.cpp

@@ -214,6 +214,16 @@ namespace physfs
 			appdata = udir;
 			appdata = udir;
 		}
 		}
 		return appdata.c_str();
 		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
 #else
 		return getUserDirectory();
 		return getUserDirectory();
 #endif
 #endif

+ 1 - 0
src/modules/filesystem/physfs/Filesystem.h

@@ -22,6 +22,7 @@
 #define LOVE_FILESYSTEM_PHYSFS_FILESYSTEM_H
 #define LOVE_FILESYSTEM_PHYSFS_FILESYSTEM_H
 
 
 // STD
 // STD
+#include <cstdlib>
 #include <cstring>
 #include <cstring>
 #include <iostream>
 #include <iostream>
 #include <string>
 #include <string>