overhaul process argument handling

get away from argument stringlists. instead, use native shell command
lines which support quoting/splitting, environment variable expansion
and redirections with well-understood semantics.

Task-number: QTCREATORBUG-542
Task-number: QTCREATORBUG-1564
This commit is contained in:
Oswald Buddenhagen
2010-10-19 11:14:03 +02:00
parent 531c70f05b
commit 1e362b0f8b
91 changed files with 592 additions and 572 deletions

View File

@@ -35,8 +35,8 @@
#include "msvcparser.h"
#include "linuxiccparser.h"
#include <utils/synchronousprocess.h>
#include <utils/qtcprocess.h>
#include <QtCore/QDebug>
#include <QtCore/QFileInfo>
@@ -768,16 +768,16 @@ MSVCToolChain::StringStringPairList MSVCToolChain::readEnvironmentSettingI(const
if (!tf.open())
return StringStringPairList();
const QString filename = tf.fileName();
QByteArray call = "call \"";
call += varsBat.toLocal8Bit();
call += '"';
QByteArray call = "call ";
call += Utils::QtcProcess::quoteArg(varsBat).toLocal8Bit();
if (!args.isEmpty()) {
call += ' ';
call += args.join(QString(QLatin1Char(' '))).toLocal8Bit();
call += Utils::QtcProcess::joinArgs(args).toLocal8Bit();
}
call += "\r\n";
tf.write(call);
const QByteArray redirect = "set > \"" + QDir::toNativeSeparators(tempOutputFileName).toLocal8Bit() + "\"\r\n";
const QByteArray redirect = "set > " + Utils::QtcProcess::quoteArg(
QDir::toNativeSeparators(tempOutputFileName)).toLocal8Bit() + "\r\n";
tf.write(redirect);
tf.flush();
tf.waitForBytesWritten(30000);