Signed-off-by: Chip Davis cdavis5x@gmail.com --- dlls/ntdll/unix/loader.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 0617fca631c1..2878cb99faa5 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -644,6 +644,20 @@ static void init_paths( char *argv[] ) bin_dir = realpath_dirname( path ); free( path ); } +#elif defined(__APPLE__) + { + uint32_t path_size = PATH_MAX; + char *path = malloc( path_size ); + while (path && _NSGetExecutablePath( path, &path_size ) < 0) + path = realloc( path, path_size ); + if (!path) + bin_dir = realpath_dirname( argv0 ); + else + { + bin_dir = realpath_dirname( path ); + free( path ); + } + } #else bin_dir = realpath_dirname( argv0 ); #endif