From 817a292690ccdea7bae185319beb22ea653db946 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 26 Aug 2019 12:41:19 +0200 Subject: Process Command: Do not needlessly interpret output as text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... when redirecting process output. Only do that if there is an output filter function. Otherwise, we break redirection of binary data. Fixes: QBS-1488 Change-Id: Ic5a1d2653fa8fc9c4f0eb5d31b7315d7aba3e030 Reviewed-by: Jörg Bornemann --- src/lib/corelib/buildgraph/processcommandexecutor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/corelib/buildgraph/processcommandexecutor.cpp b/src/lib/corelib/buildgraph/processcommandexecutor.cpp index c34a734b4..c4e4a2be6 100644 --- a/src/lib/corelib/buildgraph/processcommandexecutor.cpp +++ b/src/lib/corelib/buildgraph/processcommandexecutor.cpp @@ -274,7 +274,9 @@ void ProcessCommandExecutor::getProcessOutput(bool stdOut, ProcessResult &result } QString contentString = filterProcessOutput(content, filterFunction); if (!redirectPath.isEmpty()) { - const QProcess::ProcessError error = saveToFile(redirectPath, contentString.toLocal8Bit()); + const QByteArray dataToWrite = filterFunction.isEmpty() ? content + : contentString.toLocal8Bit(); + const QProcess::ProcessError error = saveToFile(redirectPath, dataToWrite); if (result.error() == QProcess::UnknownError && error != QProcess::UnknownError) result.d->error = error; } else { -- cgit v1.2.3