diff options
author | Marius Kintel <marius@kintel.net> | 2010-07-06 22:48:46 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2010-10-31 00:42:36 (GMT) |
commit | 021edd8aa7f73d92e416f79904c02b9f49add5f8 (patch) | |
tree | cefd3e3b2b3b7403553df7b7992672487abf7428 | |
parent | ee14c3f9442ec78ee4e3f7336a2ba18eb98f54a7 (diff) |
Ignore empty filenames when calculating absolute path
-rw-r--r-- | src/context.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/context.cc b/src/context.cc index 5aec712b..4bc6ed5 100644 --- a/src/context.cc +++ b/src/context.cc @@ -147,8 +147,16 @@ AbstractNode *Context::evaluate_module(const ModuleInstantiation *inst) const return NULL; } +/*! + Returns the absolute path to the given filename, unless it's empty. + */ QString Context::get_absolute_path(const QString &filename) const { - return QFileInfo(QDir(this->document_path), filename).absoluteFilePath(); + if (!filename.isEmpty()) { + return QFileInfo(QDir(this->document_path), filename).absoluteFilePath(); + } + else { + return filename; + } } |