mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Attempt to load the startup CFG from platform
Attempt to load it from there as well on failure.
This commit is contained in:
parent
894eea12de
commit
dfb61aff74
@ -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))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user