Platform: fix exe path detection

This commit is contained in:
李通洲
2024-01-26 10:19:21 +08:00
parent 8e316eb080
commit 6b0314f14b
+4 -2
View File
@@ -29,11 +29,13 @@ static void getExePath(FFPlatform* platform)
(int[]){CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, (int) getpid()}, 4,
exePath->chars, &exePathLen,
NULL, 0
))
) < 0)
exePathLen = 0;
else
exePathLen--; // remove terminating NUL
#endif
if (exePathLen > 0)
exePath->length = (uint32_t) (exePathLen - 1);
exePath->length = (uint32_t) exePathLen;
}
static void platformPathAddEnv(FFlist* dirs, const char* env)