1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-03 07:41:21 +00:00

Correction for launching in executable's folder for Linux & OSX

This commit is contained in:
Galleon 2015-03-25 04:56:16 -07:00
parent 7458b453e3
commit 784ca1f2de

View file

@ -32,6 +32,7 @@
#ifdef QB64_LINUX
#include <pthread.h>
#include <libgen.h> //required for dirname()
#endif
#ifdef QB64_X11
@ -29335,14 +29336,14 @@ qbs_set(startDir,func__cwd());
char pathbuf[65536];
uint32_t pathbufsize = sizeof(pathbuf);
_NSGetExecutablePath(pathbuf, &pathbufsize)
chdir(pathbuf);
chdir(dirname(pathbuf));
}
#else
{
char pathbuf[65536];
memset(pathbuf, 0, sizeof(pathbuf));
readlink("/proc/self/exe", pathbuf, 65535);
chdir(pathbuf);
chdir(dirname(pathbuf));
}
#endif
#endif