forked from qt-creator/qt-creator
Fixes: Make searchInPath() more robust.
Details: returns the argument if it is absolute and already exists.
This commit is contained in:
@@ -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"));
|
||||
|
Reference in New Issue
Block a user