Commits

Bart van Strien committed 1ed582f

Import thelinx' freedesktop patch as in bug #105

Comments (0)

Files changed (2)

src/modules/filesystem/physfs/Filesystem.cpp

 			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

src/modules/filesystem/physfs/Filesystem.h

 #define LOVE_FILESYSTEM_PHYSFS_FILESYSTEM_H
 
 // STD
+#include <cstdlib>
 #include <cstring>
 #include <iostream>
 #include <string>