fix non-bootstrapped $$system()'s line end conversions on windows

Change-Id: I026da1312bc28619dc7aa5974b7f4c00710517ac
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Oswald Buddenhagen 2012-09-17 21:18:10 +02:00 committed by The Qt Project
parent fdc64a445d
commit d92fd4ca54

View File

@ -343,6 +343,7 @@ void QMakeEvaluator::runProcess(QProcess *proc, const QString &command) const
QByteArray QMakeEvaluator::getCommandOutput(const QString &args) const
{
QByteArray out;
#ifndef QT_BOOTSTRAPPED
QProcess proc;
runProcess(&proc, args);
@ -357,9 +358,12 @@ QByteArray QMakeEvaluator::getCommandOutput(const QString &args) const
m_handler->message(QMakeHandler::EvalError, QString::fromLocal8Bit(errout));
}
# endif
return proc.readAllStandardOutput();
out = proc.readAllStandardOutput();
# ifdef Q_OS_WIN
// FIXME: Qt's line end conversion on sequential files should really be fixed
out.replace("\r\n", "\n");
# endif
#else
QByteArray out;
if (FILE *proc = QT_POPEN(QString(QLatin1String("cd ")
+ IoUtils::shellQuote(QDir::toNativeSeparators(currentDirectory()))
+ QLatin1String(" && ") + args).toLocal8Bit().constData(), "r")) {
@ -372,8 +376,8 @@ QByteArray QMakeEvaluator::getCommandOutput(const QString &args) const
}
QT_PCLOSE(proc);
}
return out;
#endif
return out;
}
void QMakeEvaluator::populateDeps(