From 021edd8aa7f73d92e416f79904c02b9f49add5f8 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Wed, 7 Jul 2010 00:48:46 +0200 Subject: Ignore empty filenames when calculating absolute path 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; + } } -- cgit v0.10.1