Skip to content

Commit

Permalink
Moved the instantiation of LogLine in ReReadBuffer into the while loop
Browse files Browse the repository at this point in the history
This change avoids the Bug that if a buffer gets ReRead that all lines are the last because of only using one reference which is updated in this loop.
#10
  • Loading branch information
zarunbal committed Nov 16, 2017
1 parent 16c3e17 commit 8a40fc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/LogExpert/Classes/Log/LogfileReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,6 @@ private void ReReadBuffer(LogBuffer logBuffer)
try
{
ILogStreamReader reader = GetLogStreamReader(fileStream, EncodingOptions, UseNewReader);
LogLine logLine = new LogLine();

string line;
long filePos = logBuffer.StartPos;
Expand All @@ -1329,6 +1328,7 @@ private void ReReadBuffer(LogBuffer logBuffer)
dropCount++;
continue;
}
LogLine logLine = new LogLine();

logLine.FullLine = line;
logLine.LineNumber = logBuffer.StartLine + logBuffer.LineCount;
Expand Down

0 comments on commit 8a40fc7

Please sign in to comment.