From d92fd4ca54ae71e9c0190d15df9c131435a4be68 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 17 Sep 2012 21:18:10 +0200 Subject: [PATCH] fix non-bootstrapped $$system()'s line end conversions on windows Change-Id: I026da1312bc28619dc7aa5974b7f4c00710517ac Reviewed-by: Joerg Bornemann --- qmake/library/qmakebuiltins.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp index 5140ed5..c76e4bf 100644 --- a/qmake/library/qmakebuiltins.cpp +++ b/qmake/library/qmakebuiltins.cpp @@ -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( -- 2.7.4