Skip to content

Commit

Permalink
Let GetExecutablePath() return real path on osx. (MaskRay#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
scturtle authored and MaskRay committed Jan 21, 2018
1 parent b5c9e22 commit 619ad11
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/platform_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ std::string GetExecutablePath() {
_NSGetExecutablePath(nullptr, &size);
char* buffer = new char[size];
_NSGetExecutablePath(buffer, &size);
std::string result(buffer);
char* resolved = realpath(buffer, nullptr);
std::string result(resolved);
delete[] buffer;
free(resolved);
return result;
#elif defined(__FreeBSD__)
static const int name[] = {
Expand Down

0 comments on commit 619ad11

Please sign in to comment.