Skip to content

Commit

Permalink
Fixed|libcore|Package: Absolute paths in package's import path
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
skyjake committed Jul 7, 2015
1 parent 68823ad commit 59aa218
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions doomsday/sdk/libcore/src/filesys/package.cpp
Expand Up @@ -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<File const>((*i)->asText()).path();
Path importPath = (*i)->asText();
if(!importPath.isAbsolute())
{
// Relative to the package root, and must exist.
importPath = self.root().locate<File const >(importPath).path();
}
paths << importPath;
}
}
return paths;
Expand Down

0 comments on commit 59aa218

Please sign in to comment.