X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=f806abe3d1dfc9cfabf13ffe32ef510b8cd9ac4b;hb=b37a8fe1087578a3236090958f2e503ad0bd2907;hp=00b2d0e1b75d08bc2117160ff715bfc5d76cc5c3;hpb=e1c9a1c270df4b13175131a12fd1940fb22edd90;p=xboard.git diff --git a/backend.c b/backend.c index 00b2d0e..f806abe 100644 --- a/backend.c +++ b/backend.c @@ -4888,14 +4888,17 @@ Boolean LoadMultiPV(int x, int y, char *buf, int index, int *start, int *end) { int startPV; + char *p; if(index < 0 || index >= strlen(buf)) return FALSE; // sanity lastX = x; lastY = y; while(index > 0 && buf[index-1] != '\n') index--; // beginning of line startPV = index; - while(buf[index] != '\n') if(buf[index++] == '\t') startPV = index; - index = startPV; - while(buf[index] && buf[index] != '\n') index++; + while(buf[index] != '\n') if(buf[index++] == '\t') startPV = index; + if(index == startPV && (p = StrCaseStr(buf+index, "PV="))) startPV = p - buf + 3; + index = startPV; + do{ while(buf[index] && buf[index] != '\n') index++; + } while(buf[index] == '\n' && buf[index+1] == '\\' && buf[index+2] == ' ' && index++); // join kibitzed PV continuation line buf[index] = 0; ParsePV(buf+startPV, FALSE); *start = startPV; *end = index-1;