diff options
author | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2015-05-11 14:53:59 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2015-05-11 14:53:59 +0200 |
commit | efb5dcbb71268de11e4a8ef271934755279a1b20 (patch) | |
tree | bc2cf9ced864a2becdf97ef96af6dfb0eced22a2 /src/lib/corelib/api/runenvironment.cpp | |
parent | ea5f5372a107be03432323f6ada678688674aa6e (diff) | |
parent | 34f9324d1ba87e6ad2115abf3981180cd691fd83 (diff) |
Merge branch 1.4 into master.
Change-Id: I2dba7958c30b522695827b7b25336278c2fdad3d
Diffstat (limited to 'src/lib/corelib/api/runenvironment.cpp')
-rw-r--r-- | src/lib/corelib/api/runenvironment.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/corelib/api/runenvironment.cpp b/src/lib/corelib/api/runenvironment.cpp index d039fc469..0113c440d 100644 --- a/src/lib/corelib/api/runenvironment.cpp +++ b/src/lib/corelib/api/runenvironment.cpp @@ -142,9 +142,11 @@ static QString findExecutable(const QStringList &fileNames) .split(HostOsInfo::pathListSeparator(), QString::SkipEmptyParts); foreach (const QString &fileName, fileNames) { + const QString exeFileName = HostOsInfo::appendExecutableSuffix(fileName); foreach (const QString &ppath, path) { - const QString fullPath = ppath + QLatin1Char('/') + fileName; - if (QFileInfo(fullPath).exists()) + const QString fullPath = ppath + QLatin1Char('/') + exeFileName; + QFileInfo fi(fullPath); + if (fi.exists() && fi.isFile() && fi.isExecutable()) return QDir::cleanPath(fullPath); } } @@ -197,7 +199,8 @@ int RunEnvironment::runTarget(const QString &targetBin, const QStringList &argum // Only check if the target is executable if we're not running it through another // known application such as msiexec or wine, as we can't check in this case anyways - if (targetBin == targetExecutable && !QFileInfo(targetExecutable).isExecutable()) { + QFileInfo fi(targetExecutable); + if (targetBin == targetExecutable && (!fi.isFile() || !fi.isExecutable())) { d->logger.qbsLog(LoggerError) << Tr::tr("File '%1' is not an executable.") .arg(QDir::toNativeSeparators(targetExecutable)); return EXIT_FAILURE; |