aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/api/runenvironment.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@theqtcompany.com>2015-05-11 14:53:59 +0200
committerChristian Kandeler <christian.kandeler@theqtcompany.com>2015-05-11 14:53:59 +0200
commitefb5dcbb71268de11e4a8ef271934755279a1b20 (patch)
treebc2cf9ced864a2becdf97ef96af6dfb0eced22a2 /src/lib/corelib/api/runenvironment.cpp
parentea5f5372a107be03432323f6ada678688674aa6e (diff)
parent34f9324d1ba87e6ad2115abf3981180cd691fd83 (diff)
Merge branch 1.4 into master.
Diffstat (limited to 'src/lib/corelib/api/runenvironment.cpp')
-rw-r--r--src/lib/corelib/api/runenvironment.cpp9
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;