summaryrefslogtreecommitdiff
path: root/Source/CTest/cmProcess.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CTest/cmProcess.cxx')
-rw-r--r--Source/CTest/cmProcess.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index 1895066a83..b028cc0875 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -79,7 +79,10 @@ bool cmProcess::Buffer::GetLine(std::string& line)
// Extract the range first..last as a line.
const char* text = &*this->begin() + this->First;
size_type length = this->Last - this->First;
- length -= (length && text[length-1] == '\r')? 1:0;
+ while(length && text[length-1] == '\r')
+ {
+ length --;
+ }
line.assign(text, length);
// Start a new range for the next line.