Improved VRML parser's ability to skip comments

This commit is contained in:
Cirilo Bernardo 2016-01-08 16:51:39 +11:00
parent 979edc4f9f
commit b04bd8c07a
1 changed files with 2 additions and 2 deletions

View File

@ -214,7 +214,7 @@ RETRY:
if( m_buf.empty() ) if( m_buf.empty() )
return false; return false;
// eliminate leading white space (including control characters) // eliminate leading white space (including control characters and comments)
while( m_linepos < m_buf.size() ) while( m_linepos < m_buf.size() )
{ {
if( m_buf[m_linepos] > 0x20 ) if( m_buf[m_linepos] > 0x20 )
@ -223,7 +223,7 @@ RETRY:
++m_linepos; ++m_linepos;
} }
if( m_linepos == m_buf.size() ) if( m_linepos == m_buf.size() || '#' == m_buf[m_linepos] )
{ {
// lines consisting entirely of white space are not unusual // lines consisting entirely of white space are not unusual
m_buf.clear(); m_buf.clear();