[iortcw] 46/95: All: Fix extension check for Com_WriteConfig_f

Simon McVittie smcv at debian.org
Fri Sep 8 10:42:03 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to tag 1.51
in repository iortcw.

commit 43ed9ff3063c512a5fe9bfd15bc7b01fd7a3c9c2
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Tue Mar 14 22:17:56 2017 -0400

    All: Fix extension check for Com_WriteConfig_f
---
 MP/code/qcommon/common.c | 5 +++--
 SP/code/qcommon/common.c | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/MP/code/qcommon/common.c b/MP/code/qcommon/common.c
index 13b36fd..a7b2925 100644
--- a/MP/code/qcommon/common.c
+++ b/MP/code/qcommon/common.c
@@ -3058,14 +3058,15 @@ void Com_WriteConfig_f( void ) {
 		return;
 	}
 
+	Q_strncpyz( filename, Cmd_Argv( 1 ), sizeof( filename ) );
+	COM_DefaultExtension( filename, sizeof( filename ), ".cfg" );
+
 	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 );
 	Com_WriteConfigToFile( filename );
 }
diff --git a/SP/code/qcommon/common.c b/SP/code/qcommon/common.c
index 402941f..5a9901e 100644
--- a/SP/code/qcommon/common.c
+++ b/SP/code/qcommon/common.c
@@ -2601,14 +2601,15 @@ void Com_WriteConfig_f( void ) {
 		return;
 	}
 
+	Q_strncpyz( filename, Cmd_Argv( 1 ), sizeof( filename ) );
+	COM_DefaultExtension( filename, sizeof( filename ), ".cfg" );
+
 	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 );
 	Com_WriteConfigToFile( filename );
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list