From e5e202a96ebb54337da0ff24e0f32af54c9a2b47 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 28 Feb 2011 11:48:33 +0100 Subject: [PATCH] Debugger[CDB]: Do not set empty environment for 'Start external'. --- src/plugins/debugger/cdb/cdbengine.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 790cb8a7312..9af511892bc 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -575,7 +575,8 @@ bool CdbEngine::startConsole(const DebuggerStartParameters &sp, QString *errorMe connect(m_consoleStub.data(), SIGNAL(wrapperStopped()), SLOT(consoleStubExited())); m_consoleStub->setWorkingDirectory(sp.workingDirectory); - m_consoleStub->setEnvironment(sp.environment); + if (sp.environment.size()) + m_consoleStub->setEnvironment(sp.environment); if (!m_consoleStub->start(sp.executable, sp.processArgs)) { *errorMessage = tr("The console process '%1' could not be started.").arg(sp.executable); return false; @@ -738,7 +739,10 @@ bool CdbEngine::launchCDB(const DebuggerStartParameters &sp, QString *errorMessa showMessage(msg, LogMisc); m_outputBuffer.clear(); - m_process.setEnvironment(mergeEnvironment(sp.environment.toStringList(), extensionFi.absolutePath())); + const QStringList environment = sp.environment.size() == 0 ? + QProcessEnvironment::systemEnvironment().toStringList() : + sp.environment.toStringList(); + m_process.setEnvironment(mergeEnvironment(environment, extensionFi.absolutePath())); if (!sp.workingDirectory.isEmpty()) m_process.setWorkingDirectory(sp.workingDirectory);