Skip to content

Commit

Permalink
Log_Manager::check_write: skip heading continuous newlines and spaces…
Browse files Browse the repository at this point in the history
… for early-check

先頭に空白行が連続する書き込みをすると、5chの仕様ではそれらを
削除したものが帰ってくるので、Log_Manager::check_write で
簡易チェックをするとき、先頭の連続する改行と空白は読み飛ばす

不具合報告:
https://next2ch.net/test/read.cgi/linux/1654053581/112-113
  • Loading branch information
jd Fedora maintainer committed Aug 12, 2023
1 parent a6bb171 commit e74a345
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/message/logmanager.cpp
Expand Up @@ -184,6 +184,20 @@ bool Log_Manager::check_write( const std::string& url, const bool newthread, con

bool flag = true;
size_t i = 0, i2 = 0;

// 簡易チェックの場合、とにかく改行でも空白でもない所まで読み飛ばす
while (1) {
if ( item.head[ i ] == '\n' ) { ++i; continue; }
if ( item.head[ i ] == ' ' ) { ++i; continue; }
break;
}

while ( i2 < headsize ) {
if ( msg[ i2 ] == '\n' ) { ++i2; continue; }
if ( msg[ i2 ] == ' ' ) { ++i2; continue; }
break;
}

while( item.head[ i ] != '\0' && i2 < headsize ){

// 空白は除く
Expand Down

0 comments on commit e74a345

Please sign in to comment.