backends: when failing to determine executable path, print full path to cwd instead of just ./

This commit is contained in:
John Törnblom 2024-11-16 15:42:54 +01:00
parent c0eda78e43
commit 38843f0f33

View file

@ -156,8 +156,9 @@ const char *Sys_GetBinaryDir(void)
SetExecutablePath(exeDir);
if (exeDir[0] == '\0') {
Com_Printf("Couldn't determine executable path. Using ./ instead.\n");
Q_strlcpy(exeDir, "./", sizeof(exeDir));
getcwd(exeDir, sizeof(exeDir));
strcat(exeDir, "/");
Com_Printf("Couldn't determine executable path. Using %s instead.\n", exeDir);
} else {
// cut off executable name
char *lastSlash = strrchr(exeDir, '/');