Attempt to load the startup CFG from platform

Attempt to load it from there as well on failure.
This commit is contained in:
Kawe Mazidjatari 2023-07-01 01:04:23 +02:00
parent 894eea12de
commit dfb61aff74

View File

@ -10,15 +10,22 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CCommandLine::AppendParametersFromFile(const char* const pszConfig) void CCommandLine::AppendParametersFromFile(const char* const pszConfig)
{ {
FILE* const pFile = fopen(pszConfig, "r"); char szTextBuf[2048];
FILE* pFile = fopen(pszConfig, "r");
if (!pFile)
{
// Try the 'PLATFORM' folder.
snprintf(szTextBuf, sizeof(szTextBuf), "platform/%s", pszConfig);
pFile = fopen(szTextBuf, "r");
if (!pFile) if (!pFile)
{ {
printf("%s: '%s' does not exist!\n", printf("%s: '%s' does not exist!\n",
__FUNCTION__, pszConfig); __FUNCTION__, pszConfig);
return; return;
} }
}
char szTextBuf[2048];
while (fgets(szTextBuf, sizeof(szTextBuf), pFile)) while (fgets(szTextBuf, sizeof(szTextBuf), pFile))
{ {