浏览代码

Merge pull request #3543 from gris-martin/patch-1

Only consider continuation tokens at end of line
Kim Kulling 4 年之前
父节点
当前提交
18ad1510f7
共有 1 个文件被更改,包括 5 次插入14 次删除
  1. 5 14
      include/assimp/IOStreamBuffer.h

+ 5 - 14
include/assimp/IOStreamBuffer.h

@@ -254,25 +254,16 @@ bool IOStreamBuffer<T>::getNextDataLine( std::vector<T> &buffer, T continuationT
         }
         }
     }
     }
 
 
-    bool continuationFound( false );
     size_t i = 0;
     size_t i = 0;
     for( ;; ) {
     for( ;; ) {
-        if ( continuationToken == m_cache[ m_cachePos ] ) {
-            continuationFound = true;
+        if ( continuationToken == m_cache[ m_cachePos ] && IsLineEnd( m_cache[ m_cachePos + 1 ] ) ) {
             ++m_cachePos;
             ++m_cachePos;
-        }
-        if ( IsLineEnd( m_cache[ m_cachePos ] ) ) {
-            if ( !continuationFound ) {
-                // the end of the data line
-                break;
-            } else {
-                // skip line end
-                while ( m_cache[m_cachePos] != '\n') {
-                    ++m_cachePos;
-                }
+            while ( m_cache[ m_cachePos ] != '\n' ) {
                 ++m_cachePos;
                 ++m_cachePos;
-                continuationFound = false;
             }
             }
+            ++m_cachePos;
+        } else if ( IsLineEnd ( m_cache[ m_cachePos ] ) ) {
+            break;
         }
         }
 
 
         buffer[ i ] = m_cache[ m_cachePos ];
         buffer[ i ] = m_cache[ m_cachePos ];