MCPcopy Create free account
hub / github.com/beefytech/Beef / BfpSystem_GetExecutablePath

Function BfpSystem_GetExecutablePath

BeefySysLib/platform/posix/PosixCommon.cpp:733–749  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

731}
732
733BFP_EXPORT void BFP_CALLTYPE BfpSystem_GetExecutablePath(char* outStr, int* inOutStrSize, BfpSystemResult* outResult)
734{
735#ifdef BF_PLATFORM_DARWIN
736 if (gExePath.IsEmpty())
737 {
738 char path[4096];
739 uint32_t size = sizeof(path);
740 if (_NSGetExecutablePath(path, &size) == 0)
741 gExePath = path;
742
743 // When when running with a './file', we end up with an annoying '/./' in our path
744 gExePath.Replace("/./", "/");
745 }
746#endif
747
748 TryStringOut(gExePath, outStr, inOutStrSize, (BfpResult*)outResult);
749}
750
751extern char **environ;
752

Callers

nothing calls this directly

Calls 3

TryStringOutFunction · 0.85
IsEmptyMethod · 0.45
ReplaceMethod · 0.45

Tested by

no test coverage detected