=============== Com_WriteConfig_f Write the config file to a specific name =============== */
| 1231 | =============== |
| 1232 | */ |
| 1233 | void Com_WriteConfig_f( void ) { |
| 1234 | char filename[MAX_QPATH]; |
| 1235 | |
| 1236 | if ( Cmd_Argc() != 2 ) { |
| 1237 | Com_Printf( "Usage: writeconfig <filename>\n" ); |
| 1238 | return; |
| 1239 | } |
| 1240 | |
| 1241 | Q_strncpyz( filename, Cmd_Argv(1), sizeof( filename ) ); |
| 1242 | COM_DefaultExtension( filename, sizeof( filename ), ".cfg" ); |
| 1243 | |
| 1244 | if(!COM_CompareExtension(filename, ".cfg")) |
| 1245 | { |
| 1246 | Com_Printf( "Com_WriteConfig_f: Only the \".cfg\" extension is supported by this command!\n" ); |
| 1247 | return; |
| 1248 | } |
| 1249 | |
| 1250 | if(!FS_FilenameCompare(filename, "mpdefault.cfg") || !FS_FilenameCompare(filename, "default.cfg")) |
| 1251 | { |
| 1252 | Com_Printf( S_COLOR_YELLOW "Com_WriteConfig_f: The filename \"%s\" is reserved! Please choose another name.\n", filename ); |
| 1253 | return; |
| 1254 | } |
| 1255 | |
| 1256 | Com_Printf( "Writing %s.\n", filename ); |
| 1257 | Com_WriteConfigToFile( filename ); |
| 1258 | } |
| 1259 | |
| 1260 | /* |
| 1261 | ================ |
nothing calls this directly
no test coverage detected