Revert "Revert "Don't traverse the entire HOME directory to find wads""

This reverts commit 443905ffb3.
This commit is contained in:
indev committed 2024-05-30 19:23:14 +03:00
1 parent faa5dbd0e7
commit 040ddb1f40
1 file changed
+5 -1
+5 -1
View File
@@ -4039,12 +4039,16 @@ static const char *locateWad(void)
#endif
#ifndef NOHOME
// find in $HOME
I_OutputMsg(",HOME");
I_OutputMsg(",HOME/" DEFAULTDIR);
if ((envstr = I_GetEnv("HOME")) != NULL)
{
char *tmp = malloc(strlen(envstr) + sizeof(DEFAULTDIR));
strcpy(tmp, envstr);
strcat(tmp, DEFAULTDIR);
WadPath = searchWad(envstr);
if (WadPath)
return WadPath;
free(tmp);
}
#endif
#ifdef DEFAULTSEARCHPATH1