Copy the saved wad directory to srb2path

This commit is contained in:
James R 2020-08-17 21:27:59 -07:00
parent c0cac645f8
commit 1bf0794d6a

View file

@ -3802,16 +3802,15 @@ boolean I_UseSavedWadDirectory(void)
{ {
boolean ok = false; boolean ok = false;
#ifdef _WIN32 #ifdef _WIN32
char path[MAX_PATH];
FILE * file = openAppDataFile("lastwaddir", "r"); FILE * file = openAppDataFile("lastwaddir", "r");
if (file != NULL) if (file != NULL)
{ {
if (fgets(path, sizeof path, file) != NULL) if (fgets(srb2path, sizeof srb2path, file) != NULL)
{ {
I_OutputMsg( I_OutputMsg(
"Going to the last known directory with srb2.srb: %s\n", "Going to the last known directory with srb2.srb: %s\n",
path); srb2path);
ok = SetCurrentDirectoryA(path); ok = SetCurrentDirectoryA(srb2path);
} }
fclose(file); fclose(file);
} }