mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-11-10 06:31:47 +00:00
Merge some file writing extension checks from OpenJK.
Thanks Ensiform. https://github.com/JACoders/OpenJK/commit/05928a57f9e4aae15a3bd0 https://github.com/JACoders/OpenJK/commit/ef124fd0fc48af164581176
This commit is contained in:
parent
f61fe5f6a0
commit
b173ac0599
2 changed files with 13 additions and 0 deletions
|
@ -191,6 +191,12 @@ void Con_Dump_f (void)
|
|||
Q_strncpyz( filename, Cmd_Argv( 1 ), sizeof( filename ) );
|
||||
COM_DefaultExtension( filename, sizeof( filename ), ".txt" );
|
||||
|
||||
if (!COM_CompareExtension(filename, ".txt"))
|
||||
{
|
||||
Com_Printf("Con_Dump_f: Only the \".txt\" extension is supported by this command!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
f = FS_FOpenFileWrite( filename );
|
||||
if (!f)
|
||||
{
|
||||
|
|
|
@ -2975,6 +2975,13 @@ void Com_WriteConfig_f( void ) {
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!COM_CompareExtension(filename, ".cfg"))
|
||||
{
|
||||
Com_Printf("Com_WriteConfig_f: Only the \".cfg\" extension is supported by this command!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
Q_strncpyz( filename, Cmd_Argv(1), sizeof( filename ) );
|
||||
COM_DefaultExtension( filename, sizeof( filename ), ".cfg" );
|
||||
Com_Printf( "Writing %s.\n", filename );
|
||||
|
|
Loading…
Reference in a new issue