made linereader work with window line endings. Closes #196

This commit is contained in:
oy 2010-10-01 12:43:44 +02:00
parent 67e9f03f23
commit a62a7413d1

View file

@ -51,6 +51,8 @@ char *CLineReader::Get()
if(m_aBuffer[m_BufferPos] == '\n' || m_aBuffer[m_BufferPos] == '\r') if(m_aBuffer[m_BufferPos] == '\n' || m_aBuffer[m_BufferPos] == '\r')
{ {
// line found // line found
if(m_aBuffer[m_BufferPos] == '\r' && m_BufferPos+1 < m_BufferSize && m_aBuffer[m_BufferPos+1] == '\n')
m_aBuffer[m_BufferPos++] = 0;
m_aBuffer[m_BufferPos] = 0; m_aBuffer[m_BufferPos] = 0;
m_BufferPos++; m_BufferPos++;
return &m_aBuffer[LineStart]; return &m_aBuffer[LineStart];