mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-20 06:58:20 +00:00
made linereader work with window line endings. Closes #196
This commit is contained in:
parent
67e9f03f23
commit
a62a7413d1
|
@ -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];
|
||||||
|
|
Loading…
Reference in a new issue