X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=a612db1d1eb5ddc0f089ec5f0d63a958afb0cba7;hb=98aa02bda540f17f1f50be00e494efafe439b004;hp=565942becba62956673cf912328a6ae12a561ec0;hpb=e946b10a06122d2beca4129080a7148596c816f7;p=xboard.git diff --git a/backend.c b/backend.c index 565942b..a612db1 100644 --- a/backend.c +++ b/backend.c @@ -2124,7 +2124,8 @@ read_from_ics(isr, closure, data, count, error) if(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 - buf[buf_len++] = ' '; // replace by space (assumes ICS does not break lines within word) + if(buf_len == 0 || buf[buf_len-1] != ' ') + buf[buf_len++] = ' '; // add space (assumes ICS does not break lines within word) } } @@ -5050,7 +5051,6 @@ int lastLoadGameUseList = FALSE; char lastLoadGameTitle[MSG_SIZ], lastLoadPositionTitle[MSG_SIZ]; ChessMove lastLoadGameStart = (ChessMove) 0; - ChessMove UserMoveTest(fromX, fromY, toX, toY, promoChar, captureOwn) int fromX, fromY, toX, toY; @@ -7475,9 +7475,6 @@ MakeMove(fromX, fromY, toX, toY, promoChar) 0, 1); return; } - SwitchClocks(); - timeRemaining[0][forwardMostMove+1] = whiteTimeRemaining; - timeRemaining[1][forwardMostMove+1] = blackTimeRemaining; if (commentList[forwardMostMove+1] != NULL) { free(commentList[forwardMostMove+1]); commentList[forwardMostMove+1] = NULL; @@ -7487,6 +7484,9 @@ MakeMove(fromX, fromY, toX, toY, promoChar) ApplyMove(fromX, fromY, toX, toY, promoChar, boards[forwardMostMove+1], castlingRights[forwardMostMove+1], &epStatus[forwardMostMove+1]); forwardMostMove++; // [HGM] bare: moved to after ApplyMove, to make sure clock interrupt finds complete board + SwitchClocks(); // uses forwardMostMove, so must be done after incrementing it ! + timeRemaining[0][forwardMostMove] = whiteTimeRemaining; + timeRemaining[1][forwardMostMove] = blackTimeRemaining; gameInfo.result = GameUnfinished; if (gameInfo.resultDetails != NULL) { free(gameInfo.resultDetails);