From bd4f4f739a3e4134da6fd1bdf39e3622dbadbdee Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Thu, 23 Feb 2023 07:44:20 -0700 Subject: [PATCH] Fix gameinfo load from same directory as file containing gameinfo lump Fixes scenario 2 in https://github.com/ZDoom/gzdoom/issues/2011#issuecomment-1440997829 --- src/d_main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 256632cfc..e34b59459 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -1798,6 +1798,8 @@ static FString ParseGameInfo(std::vector &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 &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 {