From 59aa21892d27dd196ce7f90d80281f37cad0bc1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= Date: Tue, 7 Jul 2015 21:24:01 +0300 Subject: [PATCH] Fixed|libcore|Package: Absolute paths in package's import path Relative module import paths inside a package must exist (only reason why a path wouldn't exist is an error in the contents of the package). However, absolute import paths are not in the package's control so they are accepted as-is. --- doomsday/sdk/libcore/src/filesys/package.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/doomsday/sdk/libcore/src/filesys/package.cpp b/doomsday/sdk/libcore/src/filesys/package.cpp index e5fe92771c..36f9baddc9 100644 --- a/doomsday/sdk/libcore/src/filesys/package.cpp +++ b/doomsday/sdk/libcore/src/filesys/package.cpp @@ -85,8 +85,13 @@ DENG2_PIMPL(Package) ArrayValue const &imp = self.info().geta(PACKAGE_IMPORT_PATH); DENG2_FOR_EACH_CONST(ArrayValue::Elements, i, imp.elements()) { - // The import paths are relative to the package root, and must exist. - paths << self.root().locate((*i)->asText()).path(); + Path importPath = (*i)->asText(); + if(!importPath.isAbsolute()) + { + // Relative to the package root, and must exist. + importPath = self.root().locate(importPath).path(); + } + paths << importPath; } } return paths;