diff options
author | Marius Kintel <marius@kintel.net> | 2012-06-04 09:23:37 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2012-06-04 09:23:37 (GMT) |
commit | 9698d1d2fbe6b19573a0e483a6411a8ebd0f6947 (patch) | |
tree | 915277b18db20852f827b18a00ef34c5c565c354 /src/context.cc | |
parent | 38cb06c3f0c62cbbe911a1543128bde610c45031 (diff) |
Don't prefix filenames which are already absolute with document path. Fixed #123
Diffstat (limited to 'src/context.cc')
-rw-r--r-- | src/context.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/context.cc b/src/context.cc index f96a45b..f71d2ac 100644 --- a/src/context.cc +++ b/src/context.cc @@ -32,7 +32,7 @@ #include "printutils.h" #include <boost/foreach.hpp> #include <boost/filesystem.hpp> -using namespace boost::filesystem; +namespace fs = boost::filesystem; #include "boosty.h" std::vector<const Context*> Context::ctx_stack; @@ -179,8 +179,8 @@ AbstractNode *Context::evaluate_module(const ModuleInstantiation &inst) const */ std::string Context::getAbsolutePath(const std::string &filename) const { - if (!filename.empty()) { - return boosty::absolute(path(this->document_path) / filename).string(); + if (!filename.empty() && !boosty::is_absolute(fs::path(filename))) { + return boosty::absolute(fs::path(this->document_path) / filename).string(); } else { return filename; |