Fix gameinfo load from same directory as file containing gameinfo lump

Fixes scenario 2 in https://github.com/ZDoom/gzdoom/issues/2011#issuecomment-1440997829
This commit is contained in:
John Stebbins 2023-02-23 07:44:20 -07:00 committed by Christoph Oelckers
parent ea51c92fda
commit bd4f4f739a

View file

@ -1798,6 +1798,8 @@ static FString ParseGameInfo(std::vector<std::string> &pwads, const char *fn, co
bool isDir;
const char *lastSlash = strrchr (fn, '/');
if (lastSlash == NULL)
lastSlash = strrchr (fn, ':');
sc.OpenMem("GAMEINFO", data, size);
while(sc.GetToken())
@ -1822,8 +1824,7 @@ static FString ParseGameInfo(std::vector<std::string> &pwads, const char *fn, co
FString checkpath;
if (lastSlash != NULL)
{
checkpath = FString(fn, (lastSlash - fn) + 1);
checkpath += sc.String;
checkpath = FString(fn, lastSlash - fn) + '/' + sc.String;
}
else
{