summaryrefslogtreecommitdiff
path: root/src/plugins/filesystem
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-21 01:24:37 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-21 01:24:37 +0100
commit3c659c2737b26d8ee28c727b277325852df8dd09 (patch)
tree6ad31953923b16eb8b12b679b1effd463dfd9376 /src/plugins/filesystem
parent6decad0b8e7e369bd8215f31a45dd3eae982d2a9 (diff)
Do only perform relative file lookups if a relative path is given (to allow users to include files without accidently including a global resource)
Diffstat (limited to 'src/plugins/filesystem')
-rw-r--r--src/plugins/filesystem/FileLocator.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/filesystem/FileLocator.cpp b/src/plugins/filesystem/FileLocator.cpp
index 467363b..af5244c 100644
--- a/src/plugins/filesystem/FileLocator.cpp
+++ b/src/plugins/filesystem/FileLocator.cpp
@@ -143,6 +143,11 @@ bool FileLocator::doLocate(Resource &resource, const std::string &path,
}
}
+ // If the path starts with "./" only perform relative lookups!
+ if (path.substr(0, 2) == "./") {
+ return false;
+ }
+
// Otherwise look in the search paths, search backwards, last defined search
// paths have a higher precedence
auto it = searchPaths.find(type);