fixed data path in porting.cpp for normal linux builds to get data from /binary/dir/../share/APPNAME

This commit is contained in:
Perttu Ahola 2011-01-10 18:21:44 +02:00
parent 56918c0ca4
commit 023876dafb
1 changed files with 10 additions and 2 deletions

View File

@ -143,9 +143,17 @@ void initializePaths()
#elif defined(linux) #elif defined(linux)
#include <unistd.h> #include <unistd.h>
path_userdata = std::string(getenv("HOME")) + "/." + APPNAME; char buf[BUFSIZ];
path_data = std::string(INSTALL_PREFIX) + "/share/" + APPNAME; // Get path to executable
readlink("/proc/self/exe", buf, BUFSIZ);
pathRemoveFile(buf, '/');
path_data = std::string(buf) + "/../share/" + APPNAME;
//path_data = std::string(INSTALL_PREFIX) + "/share/" + APPNAME;
path_userdata = std::string(getenv("HOME")) + "/." + APPNAME;
/* /*
OS X OS X
*/ */