Fixed so cfg_save will put .cfg at the end if not specified.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2715 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Molgrum 2007-10-05 17:23:43 +00:00
parent a07ed00f94
commit 37e0b298b3
1 changed files with 12 additions and 13 deletions

View File

@ -2504,23 +2504,22 @@ void Cmd_WriteConfig_f(void)
if (!*filename)
filename = "fte";
{
if (strstr(filename, ".."))
{
Con_Printf ("Couldn't write config %s\n",filename);
return;
}
filename = va("configs/%s",filename);
}
COM_DefaultExtension(fname, ".cfg", sizeof(fname));
FS_CreatePath(filename, FS_CONFIGONLY);
f = FS_OpenVFS(filename, "wb", FS_CONFIGONLY);
if (!f)
if (strstr(filename, ".."))
{
Con_Printf ("Couldn't write config %s\n",filename);
return;
}
snprintf(fname, sizeof(fname), "configs/%s", filename);
COM_DefaultExtension(fname, ".cfg", sizeof(fname));
FS_CreatePath(fname, FS_CONFIGONLY);
f = FS_OpenVFS(fname, "wb", FS_CONFIGONLY);
if (!f)
{
Con_Printf ("Couldn't write config %s\n",fname);
return;
}
VFS_WRITE(f, "// FTE config file\n\n", 20);
#ifndef SERVERONLY
Key_WriteBindings (f);