summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-02-11 19:40:46 +0300
committerAndrei Karas <akaras@inbox.ru>2017-02-11 19:40:46 +0300
commit82260a54abbe8a6368d3a5f5da5291e0c4f2eb08 (patch)
treec61e7cb5151660cecba810b7b3dc3ef0269dd9f5 /src
parent245fb04a1e112cc8d0918a8660474299d5ce223c (diff)
downloadplus-82260a54abbe8a6368d3a5f5da5291e0c4f2eb08.tar.gz
plus-82260a54abbe8a6368d3a5f5da5291e0c4f2eb08.tar.bz2
plus-82260a54abbe8a6368d3a5f5da5291e0c4f2eb08.tar.xz
plus-82260a54abbe8a6368d3a5f5da5291e0c4f2eb08.zip
Add checks into virtfs.cpp for correct calls add/remove dirs or archives.
Diffstat (limited to 'src')
-rw-r--r--src/utils/virtfs.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/utils/virtfs.cpp b/src/utils/virtfs.cpp
index ef70d119e..7f4c7ab3b 100644
--- a/src/utils/virtfs.cpp
+++ b/src/utils/virtfs.cpp
@@ -22,6 +22,7 @@
#include "logger.h"
+#include "utils/checkutils.h"
#include "utils/virtfile.h"
#include "utils/virtfileprivate.h"
@@ -139,24 +140,44 @@ namespace VirtFs
bool addDirToSearchPath(const std::string &newDir,
const Append append)
{
+ if (newDir.find(".zip") != std::string::npos)
+ {
+ reportAlways("Called addDirToSearchPath with zip archive");
+ return false;
+ }
return PHYSFS_addToSearchPath(newDir.c_str(),
append == Append_true ? 1 : 0);
}
bool removeDirFromSearchPath(const std::string &oldDir)
{
+ if (oldDir.find(".zip") != std::string::npos)
+ {
+ reportAlways("Called removeDirFromSearchPath with zip archive");
+ return false;
+ }
return PHYSFS_removeFromSearchPath(oldDir.c_str());
}
bool addZipToSearchPath(const std::string &newDir,
const Append append)
{
+ if (newDir.find(".zip") == std::string::npos)
+ {
+ reportAlways("Called addZipToSearchPath without zip archive");
+ return false;
+ }
return PHYSFS_addToSearchPath(newDir.c_str(),
append == Append_true ? 1 : 0);
}
bool removeZipFromSearchPath(const std::string &oldDir)
{
+ if (oldDir.find(".zip") == std::string::npos)
+ {
+ reportAlways("Called removeZipFromSearchPath without zip archive");
+ return false;
+ }
return PHYSFS_removeFromSearchPath(oldDir.c_str());
}