Fix finding specs in the unsupported/ directory.
authorThomas McGuire <thomas.mcguire@kdab.com>
Tue, 6 Mar 2012 12:13:09 +0000 (13:13 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 6 Mar 2012 16:47:46 +0000 (17:47 +0100)
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>
qmake/option.cpp

index 3fc66a8..ef613b9 100644 (file)
@@ -149,8 +149,11 @@ static QString detectProjectFile(const QString &path)
 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;
 }