diff options
author | Tobias Hunger <[email protected]> | 2012-01-25 16:26:47 +0100 |
---|---|---|
committer | Tobias Hunger <[email protected]> | 2012-02-03 09:11:24 +0100 |
commit | a309c26f1bb76fc1a55faf109d18289e96a2fffa (patch) | |
tree | e4f01c9374715cf92d7c3bf2d7e5dcca91d76458 /src/plugins/vcsbase/vcsbaseplugin.cpp | |
parent | 1fe85174eb019bfd525d4a898cd1ce710314c4dc (diff) |
VCS: Never try to run empty binaries
Never try to run empty binaries.
Task-number: QTCREATORBUG-6849
Change-Id: I591fdb9d39394fc8097908f5934a1a96518859cb
Reviewed-by: Hugues Delorme <[email protected]>
Diffstat (limited to 'src/plugins/vcsbase/vcsbaseplugin.cpp')
-rw-r--r-- | src/plugins/vcsbase/vcsbaseplugin.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp index 7af504a7f0f..4d137dec8d9 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.cpp +++ b/src/plugins/vcsbase/vcsbaseplugin.cpp @@ -793,6 +793,12 @@ static SynchronousProcessResponse runVcsFullySynchronously(const QString &workin unsigned flags, QTextCodec *outputCodec = 0) { + SynchronousProcessResponse response; + if (binary.isEmpty()) { + response.result = SynchronousProcessResponse::StartFailed; + return response; + } + VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance(); // Set up process @@ -809,7 +815,6 @@ static SynchronousProcessResponse runVcsFullySynchronously(const QString &workin // Start process->start(binary, arguments, QIODevice::ReadOnly); process->closeWriteChannel(); - SynchronousProcessResponse response; if (!process->waitForStarted()) { response.result = SynchronousProcessResponse::StartFailed; return response; @@ -869,6 +874,13 @@ SynchronousProcessResponse VcsBasePlugin::runVcs(const QString &workingDir, unsigned flags, QTextCodec *outputCodec) { + SynchronousProcessResponse response; + + if (binary.isEmpty()) { + response.result = SynchronousProcessResponse::StartFailed; + return response; + } + VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance(); if (!(flags & SuppressCommandLogging)) @@ -901,8 +913,6 @@ SynchronousProcessResponse VcsBasePlugin::runVcs(const QString &workingDir, VcsBase::VcsBasePlugin::setProcessEnvironment(&env, (flags & ForceCLocale)); - SynchronousProcessResponse response; - if (flags & FullySynchronously) { response = runVcsFullySynchronously(workingDir, binary, arguments, timeOutMS, env, flags, outputCodec); @@ -964,6 +974,9 @@ bool VcsBasePlugin::runFullySynchronous(const QString &workingDirectory, int timeoutMS, bool logCommandToWindow) { + if (binary.isEmpty()) + return false; + VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance(); if (logCommandToWindow) |