summaryrefslogtreecommitdiff
path: root/src/utils/paths.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-02-05 17:38:54 +0300
committerAndrei Karas <akaras@inbox.ru>2012-02-05 17:38:54 +0300
commit8db4a7da23c36718152ca29cfb067bcfc759a92f (patch)
tree0dc6ef2f71248d20a3a00432d644140b4cda68e2 /src/utils/paths.cpp
parent261ff1fa32cb75254d68d214f13f8a5aaec33962 (diff)
downloadmv-8db4a7da23c36718152ca29cfb067bcfc759a92f.tar.gz
mv-8db4a7da23c36718152ca29cfb067bcfc759a92f.tar.bz2
mv-8db4a7da23c36718152ca29cfb067bcfc759a92f.tar.xz
mv-8db4a7da23c36718152ca29cfb067bcfc759a92f.zip
Move path functions from stringutils to paths.
Diffstat (limited to 'src/utils/paths.cpp')
-rw-r--r--src/utils/paths.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utils/paths.cpp b/src/utils/paths.cpp
index 8decb6e95..faa1882e6 100644
--- a/src/utils/paths.cpp
+++ b/src/utils/paths.cpp
@@ -55,3 +55,13 @@ bool isRealPath(const std::string &str)
std::string path = getRealPath(str);
return str == path;
}
+
+bool checkPath(std::string path)
+{
+ if (path.empty())
+ return true;
+ return path.find("../") == std::string::npos
+ && path.find("..\\") == std::string::npos
+ && path.find("/..") == std::string::npos
+ && path.find("\\..") == std::string::npos;
+}