diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2019-08-26 12:41:19 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2019-08-26 11:30:46 +0000 |
commit | 817a292690ccdea7bae185319beb22ea653db946 (patch) | |
tree | 609fbf3d6781c60c6d00f77f6965a3410e4a4012 /src | |
parent | 94a097d95e9bfe485cebd7a5a9acd56301c54f04 (diff) |
Process Command: Do not needlessly interpret output as text
... 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 <joerg.bornemann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/corelib/buildgraph/processcommandexecutor.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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 { |