summaryrefslogtreecommitdiff
path: root/tools/scaninc/c_file.cpp
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2017-07-23 22:37:53 -0400
committeryenatch <yenatch@gmail.com>2017-07-23 22:37:53 -0400
commitd2a1118862eac8473d056cfd8a8af28be2b947fd (patch)
tree5c13a41c2f06ba2582eda8d355f4abcf63d5787a /tools/scaninc/c_file.cpp
parente73ec108adb15cda40c17ebe891d25460c3c42b3 (diff)
scaninc: optimize for unix newlines
this probably has no effect whatsoever
Diffstat (limited to 'tools/scaninc/c_file.cpp')
-rw-r--r--tools/scaninc/c_file.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/scaninc/c_file.cpp b/tools/scaninc/c_file.cpp
index e4e20e609..035af4e1b 100644
--- a/tools/scaninc/c_file.cpp
+++ b/tools/scaninc/c_file.cpp
@@ -111,16 +111,16 @@ bool CFile::ConsumeHorizontalWhitespace()
bool CFile::ConsumeNewline()
{
- if (m_buffer[m_pos] == '\r' && m_buffer[m_pos + 1] == '\n')
+ if (m_buffer[m_pos] == '\n')
{
- m_pos += 2;
+ m_pos++;
m_lineNum++;
return true;
}
- if (m_buffer[m_pos] == '\n')
+ if (m_buffer[m_pos] == '\r' && m_buffer[m_pos + 1] == '\n')
{
- m_pos++;
+ m_pos += 2;
m_lineNum++;
return true;
}