mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Fixed exe path issue
This commit is contained in:
parent
e097ffc4fe
commit
3123aad0d1
1 changed files with 15 additions and 7 deletions
|
@ -542,12 +542,20 @@ BFP_EXPORT void BFP_CALLTYPE BfpSystem_Init(int version, BfpSystemInitFlags flag
|
||||||
}
|
}
|
||||||
|
|
||||||
BFP_EXPORT void BFP_CALLTYPE BfpSystem_SetCommandLine(int argc, char** argv)
|
BFP_EXPORT void BFP_CALLTYPE BfpSystem_SetCommandLine(int argc, char** argv)
|
||||||
|
{
|
||||||
|
char exePath[PATH_MAX] = { 0 };
|
||||||
|
int nchar = readlink("/proc/self/exe", exePath, PATH_MAX);
|
||||||
|
if (nchar > 0)
|
||||||
|
{
|
||||||
|
gExePath = exePath;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
char* relPath = argv[0];
|
char* relPath = argv[0];
|
||||||
|
|
||||||
char* cwd = getcwd(NULL, 0);
|
char* cwd = getcwd(NULL, 0);
|
||||||
gExePath = GetAbsPath(relPath, cwd);
|
gExePath = GetAbsPath(relPath, cwd);
|
||||||
free(cwd);
|
free(cwd);
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < argc; i++)
|
for (int i = 0; i < argc; i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue