Use getcwd() in Process::getPath() on OS X

The "dfhack" script sets up the proper working directory
develop
lethosor 2015-06-29 10:11:46 -04:00
parent 0f3753095b
commit 6cfc855e19
1 changed files with 2 additions and 0 deletions

@ -262,6 +262,8 @@ string Process::getPath()
char path[1024]; char path[1024];
char *real_path; char *real_path;
uint32_t size = sizeof(path); uint32_t size = sizeof(path);
if (getcwd(path, size))
return string(path);
if (_NSGetExecutablePath(path, &size) == 0) { if (_NSGetExecutablePath(path, &size) == 0) {
real_path = realpath(path, NULL); real_path = realpath(path, NULL);
} }