From 6cfc855e19e5659f78f216a9570e2ddc2373f0e2 Mon Sep 17 00:00:00 2001 From: lethosor Date: Mon, 29 Jun 2015 10:11:46 -0400 Subject: [PATCH] Use getcwd() in Process::getPath() on OS X The "dfhack" script sets up the proper working directory --- library/Process-darwin.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/Process-darwin.cpp b/library/Process-darwin.cpp index aaafdd79e..230809cd3 100644 --- a/library/Process-darwin.cpp +++ b/library/Process-darwin.cpp @@ -262,6 +262,8 @@ string Process::getPath() char path[1024]; char *real_path; uint32_t size = sizeof(path); + if (getcwd(path, size)) + return string(path); if (_NSGetExecutablePath(path, &size) == 0) { real_path = realpath(path, NULL); }