From 535841fcb50026884677d3bc00b8d388cbce3b3e Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 15 Jun 2008 21:52:51 +0000 Subject: [PATCH] If it extended to the end of the line the length of the last attributes run of a history line would not be initialized correctly. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25968 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/terminal/HistoryBuffer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/apps/terminal/HistoryBuffer.cpp b/src/apps/terminal/HistoryBuffer.cpp index 7fe7d096f3..98e1cb7603 100644 --- a/src/apps/terminal/HistoryBuffer.cpp +++ b/src/apps/terminal/HistoryBuffer.cpp @@ -90,7 +90,8 @@ HistoryBuffer::GetTerminalLineAt(int32 index, TerminalLine* buffer) const if (charCount == nextAttributesAt) { if (attributesRunCount > 0) { attributes = attributesRun->attributes; - nextAttributesAt = attributesRun->offset + attributesRun->length; + nextAttributesAt = attributesRun->offset + + attributesRun->length; attributesRun++; attributesRunCount--; } else { @@ -180,6 +181,10 @@ HistoryBuffer::AddLine(const TerminalLine* line) i++; } + // set the last attributes run's length + if (attributes != 0) + attributesRun->length = line->length - attributesRun->offset; + historyLine->softBreak = line->softBreak; //debug_printf(" line: \"%.*s\", history size now: %ld\n", historyLine->byteLength, historyLine->Chars(), fSize); }