From 02051bb0677f7901902c890437f39b3e1f03e8cd Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 5 Jun 2012 14:23:47 +0000 Subject: [PATCH] fix runtime directory detection on MacOS --- src/commands.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/commands.cc b/src/commands.cc index e3e8cc2e..3aea2c11 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -607,6 +607,9 @@ void exec_commands_in_runtime_file(const CommandParameters& params, #elif defined(__APPLE__) uint32_t bufsize = 2048 - filename.length(); _NSGetExecutablePath(buffer, &bufsize); + char* canonical_path = realpath(buffer, NULL); + strncpy(buffer, canonical_path, 2048 - filename.length()); + free(canonical_path); #else # error "finding executable path is not implemented on this platform" #endif