diff --git a/src/posix.cpp b/src/posix.cpp index 569f0b08f9..0d34e2828a 100644 --- a/src/posix.cpp +++ b/src/posix.cpp @@ -93,6 +93,8 @@ pathOfExecutable(System* s, const char** retBuf, unsigned* size) CFBundleRef bundle = CFBundleGetMainBundle(); CFURLRef url = CFBundleCopyExecutableURL(bundle); CFStringRef path = CFURLCopyPath(url); + path = CFURLCreateStringByReplacingPercentEscapes(kCFAllocatorDefault, + path, CFSTR("")); CFIndex pathSize = CFStringGetMaximumSizeOfFileSystemRepresentation(path); char* buffer = reinterpret_cast(allocate(s, pathSize)); if (CFStringGetFileSystemRepresentation(path, buffer, pathSize)) {