[iortcw] 17/497: MP: Add stub for FS_Delete (not used in MP)
Simon McVittie
smcv at debian.org
Fri Sep 8 10:36:04 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to annotated tag 1.42d
in repository iortcw.
commit 47a1152a47f4aa62bc654e4ce27e2a69693da383
Author: M4N4T4RMS at gmail.com <M4N4T4RMS at gmail.com@e65d2741-a53d-b2dc-ae96-bb75fa5e4c4a>
Date: Mon Jan 20 22:21:32 2014 +0000
MP: Add stub for FS_Delete (not used in MP)
---
MP/code/qcommon/files.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/MP/code/qcommon/files.c b/MP/code/qcommon/files.c
index dc3dd9b..15b5dce 100644
--- a/MP/code/qcommon/files.c
+++ b/MP/code/qcommon/files.c
@@ -1719,6 +1719,40 @@ qboolean FS_CL_ExtractFromPakFile( void *searchpath, const char *fullpath, const
#endif
/*
+==============
+FS_Delete
+TTimo - this was not in the 1.30 filesystem code
+using fs_homepath for the file to remove
+==============
+*/
+int FS_Delete( char *filename ) {
+#if 0 // Stub...not used in MP
+ char *ospath;
+
+ if ( !fs_searchpaths ) {
+ Com_Error( ERR_FATAL, "Filesystem call made without initialization\n" );
+ }
+
+ if ( !filename || filename[0] == 0 ) {
+ return 0;
+ }
+
+ // for safety, only allow deletion from the save directory
+ if ( Q_strncmp( filename, "save/", 5 ) != 0 ) {
+ return 0;
+ }
+
+ ospath = FS_BuildOSPath( fs_homepath->string, fs_gamedir, filename );
+
+ if ( remove( ospath ) != -1 ) { // success
+ return 1;
+ }
+#endif
+
+ return 0;
+}
+
+/*
=================
FS_Read
--
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