mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-05 17:00:26 +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
|
||||
#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
|
||||
|
|
Loading…
Reference in a new issue