diff options
author | Brad King <brad.king@kitware.com> | 2016-01-14 21:14:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-01-19 20:49:48 (GMT) |
commit | dc039cc02c857b2c418481533a236dad6a586a7f (patch) | |
tree | 134af7c5d9aaadfa6da87b5993842349876d3cd6 /Source/cmSystemTools.cxx | |
parent | ffa2a8c967df09c4630e50e7c7339e36b027ecaf (diff) | |
download | CMake-dc039cc02c857b2c418481533a236dad6a586a7f.zip CMake-dc039cc02c857b2c418481533a236dad6a586a7f.tar.gz CMake-dc039cc02c857b2c418481533a236dad6a586a7f.tar.bz2 |
cmSystemTools: Drop redundant condition in RunSingleCommand
The output processing loop is already guarded by a condition so we do
not need to repeat the condition inside the loop.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index a89a6e0b..2b0c2ed 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -696,19 +696,17 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string>const& command, { while((pipe = cmsysProcess_WaitForData(cp, &data, &length, 0)) > 0) { - if(captureStdOut || captureStdErr || outputflag != OUTPUT_NONE) + // Translate NULL characters in the output into valid text. + // Visual Studio 7 puts these characters in the output of its + // build process. + for(int i=0; i < length; ++i) { - // Translate NULL characters in the output into valid text. - // Visual Studio 7 puts these characters in the output of its - // build process. - for(int i=0; i < length; ++i) + if(data[i] == '\0') { - if(data[i] == '\0') - { - data[i] = ' '; - } + data[i] = ' '; } } + if(pipe == cmsysProcess_Pipe_STDOUT || (pipe == cmsysProcess_Pipe_STDERR && captureStdOut == captureStdErr)) |