VmaReplay: Added support for Windows end of lines.

This commit is contained in:
Adam Sawicki 2018-11-20 11:29:17 +01:00
parent 99f2d3543c
commit df2404b6a5

View File

@ -12,6 +12,11 @@ bool LineSplit::GetNextLine(StrRange& out)
while(currLineEnd < m_NumBytes && m_Data[currLineEnd] != '\n')
++currLineEnd;
out.end = m_Data + currLineEnd;
// Ignore trailing '\r' to support Windows end of line.
if(out.end > out.beg && *(out.end - 1) == '\r')
{
--out.end;
}
m_NextLineBeg = currLineEnd + 1; // Past '\n'
++m_NextLineIndex;
return true;