From f2b19e6c8795369a54768b8b9552e249c4efab61 Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Sun, 3 Aug 2014 09:10:02 -0400 Subject: [PATCH] Add more accurate return value for DeleteFile when using Valve FS. --- core/logic/smn_filesystem.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/logic/smn_filesystem.cpp b/core/logic/smn_filesystem.cpp index 7e1536a1..e2f2add4 100644 --- a/core/logic/smn_filesystem.cpp +++ b/core/logic/smn_filesystem.cpp @@ -125,9 +125,21 @@ public: inline bool Remove(const char *pFilePath) { if (_fstype == FSType::VALVE) - return smcore.filesystem->RemoveFile(pFilePath), true; + { + if (!smcore.filesystem->FileExists(pFilePath)) + return false; + + smcore.filesystem->RemoveFile(pFilePath); + + if (smcore.filesystem->FileExists(pFilePath)) + return false; + + return true; + } else + { return unlink(pFilePath) == 0; + } } inline bool EndOfFile(void *pFile)