only create autoload subdirectory relative to D_DoomPrefDir() (#619)

This commit is contained in:
Fabian Greffrath 2022-06-21 15:55:27 +02:00 committed by GitHub
parent bd62ffe056
commit 91d46c9b6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -669,15 +669,16 @@ char *D_DoomPrefDir(void)
static struct { static struct {
const char *dir; const char *dir;
char *(*func)(void); char *(*func)(void);
boolean createdir;
} autoload_basedirs[] = { } autoload_basedirs[] = {
#ifdef WOOFDATADIR #ifdef WOOFDATADIR
{WOOFDATADIR, NULL}, {WOOFDATADIR, NULL, false},
#endif #endif
{NULL, D_DoomPrefDir}, {NULL, D_DoomPrefDir, true},
#if !defined(_WIN32) || defined(_WIN32_WCE) #if !defined(_WIN32) || defined(_WIN32_WCE)
{NULL, D_DoomExeDir}, {NULL, D_DoomExeDir, false},
#endif #endif
{NULL, NULL}, {NULL, NULL, false},
}; };
static char **autoload_paths = NULL; static char **autoload_paths = NULL;
@ -725,7 +726,10 @@ static void PrepareAutoloadPaths (void)
break; break;
} }
M_MakeDirectory(autoload_paths[i]); if (autoload_basedirs[i].createdir)
{
M_MakeDirectory(autoload_paths[i]);
}
} }
} }