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

Only consider continuation tokens at end of line
pull/3546/head^2
Kim Kulling 2021-01-02 00:12:57 +01:00 committed by GitHub
commit 18ad1510f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 14 deletions

View File

@ -254,25 +254,16 @@ bool IOStreamBuffer<T>::getNextDataLine( std::vector<T> &buffer, T continuationT
}
}
bool continuationFound( false );
size_t i = 0;
for( ;; ) {
if ( continuationToken == m_cache[ m_cachePos ] ) {
continuationFound = true;
if ( continuationToken == m_cache[ m_cachePos ] && IsLineEnd( m_cache[ m_cachePos + 1 ] ) ) {
++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;
}
++m_cachePos;
continuationFound = false;
}
} else if ( IsLineEnd ( m_cache[ m_cachePos ] ) ) {
break;
}
buffer[ i ] = m_cache[ m_cachePos ];