From a087b138f5c8328b56e977a40e1a6ab106c772f8 Mon Sep 17 00:00:00 2001
From: dt <qtc-commiter@nokia.com>
Date: Fri, 23 Jan 2009 18:53:16 +0100
Subject: [PATCH] Fixes:    Make searchInPath() more robust.

Details:  returns the argument if it is absolute and already exists.
---
 src/plugins/projectexplorer/environment.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/plugins/projectexplorer/environment.cpp b/src/plugins/projectexplorer/environment.cpp
index 38f35af9727..cfc9c2213d2 100644
--- a/src/plugins/projectexplorer/environment.cpp
+++ b/src/plugins/projectexplorer/environment.cpp
@@ -188,6 +188,9 @@ QString Environment::searchInPath(QString executable)
 //    qDebug()<<"looking for "<<executable<< "in PATH: "<<m_values.value("PATH");
     if (executable.isEmpty())
         return QString::null;
+    QFileInfo fi(executable);
+    if (fi.isAbsolute() && fi.exists())
+        return executable;
 #ifdef Q_OS_WIN
     if (!executable.endsWith(QLatin1String(".exe")))
         executable.append(QLatin1String(".exe"));
-- 
GitLab