The -spec argument was interpreted as a relative directory as
soon as it contained a slash. Fix this by checking if the
directory exists before attempting to interpret it.
Change-Id: Ide8f0418abc719b0be582d2d72642a141f6c6dea
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
static QString cleanSpec(const QString &spec)
{
QString ret = QDir::cleanPath(spec);
- if (ret.contains('/'))
- ret = QDir::cleanPath(QFileInfo(ret).absoluteFilePath());
+ if (ret.contains('/')) {
+ const QFileInfo specDirInfo(ret);
+ if (specDirInfo.exists() && specDirInfo.isDir())
+ ret = QDir::cleanPath(specDirInfo.absoluteFilePath());
+ }
return ret;
}