From e9e804888eb3330dae4144afb4026447895834a2 Mon Sep 17 00:00:00 2001
From: Tobias Hunger <tobias.hunger@nokia.com>
Date: Thu, 22 Mar 2012 11:27:30 +0100
Subject: [PATCH] Win: Avoid long creator startup times with '\' in PATH

Task-number: QTCREATORBUG-6501
Change-Id: Idfe050486db2d486e895bf6670cad3084871c44a
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
---
 src/libs/utils/environment.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/libs/utils/environment.cpp b/src/libs/utils/environment.cpp
index 4390150f732..d6d0124d003 100644
--- a/src/libs/utils/environment.cpp
+++ b/src/libs/utils/environment.cpp
@@ -249,8 +249,11 @@ QString Environment::searchInPath(const QStringList &executables,
         if (exec.indexOf(slash) != -1)
             continue;
         foreach (const QString &p, path()) {
-            QString fp = p;
-            fp += slash;
+            QString fp = QDir::fromNativeSeparators(p);
+            // Avoid turing / into // on windows which triggers windows to check
+            // for network drives!
+            if (!fp.endsWith(slash))
+                fp += slash;
             fp += exec;
             const QFileInfo fi(fp);
             if (fi.exists() && fi.isExecutable() && !fi.isDir())
-- 
GitLab