make sure com_gamedir exists before writing config.cfg

This commit is contained in:
Bill Currie 2000-12-04 16:07:08 +00:00
parent 37eb211c0a
commit 6b3f8e5dba

View file

@ -1425,7 +1425,9 @@ void Host_WriteConfiguration (void)
if (host_initialized)
{
f = Qopen (va("%s/config.cfg",com_gamedir), "w");
char *path = va("%s/config.cfg",com_gamedir);
COM_CreatePath (path);
f = Qopen (path, "w");
if (!f)
{
Con_Printf ("Couldn't write config.cfg.\n");