mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-05 15:50:25 +00:00
Correction for launching in executable's folder for Linux & OSX
This commit is contained in:
parent
7458b453e3
commit
784ca1f2de
|
@ -32,6 +32,7 @@
|
||||||
|
|
||||||
#ifdef QB64_LINUX
|
#ifdef QB64_LINUX
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
#include <libgen.h> //required for dirname()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef QB64_X11
|
#ifdef QB64_X11
|
||||||
|
@ -29335,14 +29336,14 @@ qbs_set(startDir,func__cwd());
|
||||||
char pathbuf[65536];
|
char pathbuf[65536];
|
||||||
uint32_t pathbufsize = sizeof(pathbuf);
|
uint32_t pathbufsize = sizeof(pathbuf);
|
||||||
_NSGetExecutablePath(pathbuf, &pathbufsize)
|
_NSGetExecutablePath(pathbuf, &pathbufsize)
|
||||||
chdir(pathbuf);
|
chdir(dirname(pathbuf));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
char pathbuf[65536];
|
char pathbuf[65536];
|
||||||
memset(pathbuf, 0, sizeof(pathbuf));
|
memset(pathbuf, 0, sizeof(pathbuf));
|
||||||
readlink("/proc/self/exe", pathbuf, 65535);
|
readlink("/proc/self/exe", pathbuf, 65535);
|
||||||
chdir(pathbuf);
|
chdir(dirname(pathbuf));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue