Skip to content

Commit fdba92d

Browse files
committed
Be more tolerant if we cannot decide the executable location.
e.g. FreeBSD Signed-off-by: Andrea Odetti <[email protected]>
1 parent 059af2e commit fdba92d

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

source/frontends/common2/gnuframe.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,17 @@ namespace
6666
}
6767
}
6868

69-
throw std::runtime_error("Cannot found the resource path: " + target);
69+
// this is now used only for g_sProgramDir
70+
// which only matters for Debug Symbols and Printer Filename
71+
// let's be tolerant and use cwd
72+
73+
char szFilename[MAX_PATH];
74+
if (GetCurrentDirectory(sizeof(szFilename), szFilename))
75+
{
76+
return std::string(szFilename) + PATH_SEPARATOR;
77+
}
78+
79+
throw std::runtime_error("Cannot find the resource path for: " + target);
7080
}
7181

7282
}

source/linux/libwindows/fileapi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,5 @@ HANDLE CreateFile(LPCTSTR lpFileName,
7171

7272
DWORD GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh);
7373

74+
// non "/" terminated
7475
DWORD GetCurrentDirectory(DWORD, char *);

0 commit comments

Comments
 (0)