From 784ca1f2de71f90e855270db2bf535a8e8a60da5 Mon Sep 17 00:00:00 2001 From: Galleon Date: Wed, 25 Mar 2015 04:56:16 -0700 Subject: [PATCH] Correction for launching in executable's folder for Linux & OSX --- internal/c/libqb.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/c/libqb.cpp b/internal/c/libqb.cpp index 61b8e3367..2e06d2027 100644 --- a/internal/c/libqb.cpp +++ b/internal/c/libqb.cpp @@ -32,6 +32,7 @@ #ifdef QB64_LINUX #include +#include //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