X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=e197f00243b9e0615646be2ca04009b5ffd0fc48;hb=6ee5f4d3418f9b1b6c537ebf8a9ddd59341877c5;hp=9e1bf62f7d3abb681755b40e082250901da23de2;hpb=7fb56edee87ea24c7b2b6b0065e73e5053650383;p=xboard.git diff --git a/backend.c b/backend.c old mode 100644 new mode 100755 index 9e1bf62..e197f00 --- a/backend.c +++ b/backend.c @@ -2022,7 +2022,8 @@ static int loggedOn = FALSE; int gs_gamenum; char gs_kind[MSG_SIZ]; static char player1Name[128] = ""; -static char player2Name[128] = ""; +static char player2Name[128] = ""; +static char cont_seq[] = "\n\\ "; static int player1Rating = -1; static int player2Rating = -1; /*----------------------------*/ @@ -2055,6 +2056,8 @@ read_from_ics(isr, closure, data, count, error) static int firstTime = TRUE, intfSet = FALSE; static ColorClass prevColor = ColorNormal; static int savingComment = FALSE; + static int cmatch = 0; // continuation sequence match + char *bp; char str[500]; int i, oldi; int buf_len; @@ -2085,18 +2088,66 @@ read_from_ics(isr, closure, data, count, error) buf[i] = buf[leftover_start + i]; } - /* Copy in new characters, removing nulls and \r's */ - buf_len = leftover_len; - for (i = 0; i < count; i++) { - if (data[i] != NULLCHAR && data[i] != '\r') - buf[buf_len++] = data[i]; - if(!appData.noJoin && buf_len >= 5 && buf[buf_len-5]=='\n' && buf[buf_len-4]=='\\' && - buf[buf_len-3]==' ' && buf[buf_len-2]==' ' && buf[buf_len-1]==' ') { - buf_len -= 5; // [HGM] ICS: join continuation line of Lasker 2.2.3 server with previous - if(buf_len == 0 || buf[buf_len-1] != ' ') - buf[buf_len++] = ' '; // add space (assumes ICS does not break lines within word) - } - } + /* copy new characters into the buffer */ + bp = buf + leftover_len; + buf_len=leftover_len; + for (i=0; i