summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-03-13 21:18:18 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2019-03-13 21:18:18 +0000
commit53c21c71274ab32a26b80c6a5da8b7dff7731005 (patch)
tree8bf995ef74803c6ab3e3b6da51cfc595cd32c8b2
parentMinor build fixes (diff)
downloadproject2-53c21c71274ab32a26b80c6a5da8b7dff7731005.tar.bz2
project2-53c21c71274ab32a26b80c6a5da8b7dff7731005.tar.xz
project2-53c21c71274ab32a26b80c6a5da8b7dff7731005.zip
Convert abs paths to relative path when resolving scripts by name
-rw-r--r--project2/common/scripts.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/project2/common/scripts.cpp b/project2/common/scripts.cpp
index 983a156..5f4ba64 100644
--- a/project2/common/scripts.cpp
+++ b/project2/common/scripts.cpp
@@ -69,6 +69,9 @@ ScriptReaderPtr
ScriptReader::resolveScript(const std::string & group, const std::string & name, bool ii)
{
std::filesystem::path e(name);
+ if (e.is_absolute()) {
+ e = e.lexically_relative("/");
+ }
while (!e.empty()) {
ScriptKey sk(group, e.string());
ScriptReaderPtr rs = AppInstance::current().cachedScript(sk);