diff options
Diffstat (limited to 'src/qcommon/files.c')
-rw-r--r-- | src/qcommon/files.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/qcommon/files.c b/src/qcommon/files.c index a9c43b43..f3e4ba70 100644 --- a/src/qcommon/files.c +++ b/src/qcommon/files.c @@ -532,17 +532,19 @@ qboolean FS_CreatePath (char *OSPath) { ================= FS_CheckFilenameIsNotExecutable -ERR_FATAL if trying to maniuplate a file with the platform library extension +ERR_FATAL if trying to maniuplate a file with the platform library, QVM, or pk3 extension ================= */ static void FS_CheckFilenameIsNotExecutable( const char *filename, const char *function ) { - // Check if the filename ends with the library extension - if(COM_CompareExtension(filename, DLL_EXT)) + // Check if the filename ends with the library, QVM, or pk3 extension + if( COM_CompareExtension( filename, DLL_EXT ) + || COM_CompareExtension( filename, ".qvm" ) + || COM_CompareExtension( filename, ".pk3" ) ) { Com_Error( ERR_FATAL, "%s: Not allowed to manipulate '%s' due " - "to %s extension", function, filename, DLL_EXT ); + "to %s extension", function, filename, COM_GetExtension( filename ) ); } } @@ -743,7 +745,7 @@ FS_SV_Rename =========== */ -void FS_SV_Rename( const char *from, const char *to ) { +void FS_SV_Rename( const char *from, const char *to, qboolean safe ) { char *from_ospath, *to_ospath; if ( !fs_searchpaths ) { @@ -762,7 +764,9 @@ void FS_SV_Rename( const char *from, const char *to ) { Com_Printf( "FS_SV_Rename: %s --> %s\n", from_ospath, to_ospath ); } - FS_CheckFilenameIsNotExecutable( to_ospath, __func__ ); + if ( safe ) { + FS_CheckFilenameIsNotExecutable( to_ospath, __func__ ); + } rename(from_ospath, to_ospath); } |