X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=parser.c;h=8b1dc3f1c69da56b8302b9c3f6bfde736c8cdc91;hb=4df745f07a4fb7fa7136763be313779df2a26255;hp=6da13d40b7c73700ee52e2de2dabbe149e928ed4;hpb=c2d598e998107fe4d483b1976ce2d6fd494c88a7;p=xboard.git diff --git a/parser.c b/parser.c index 6da13d4..8b1dc3f 100644 --- a/parser.c +++ b/parser.c @@ -174,6 +174,10 @@ NextUnit (char **p) if(fromString) return 0; // we are parsing string, so the end is really the end *p = inPtr = inputBuf; if(!ReadLine()) return 0; // EOF + } else if(inPtr > inputBuf + PARSEBUFSIZE/2) { // buffer fills up with already parsed stuff + char *q = *p, *r = inputBuf; + while(*r++ = *q++); + *p = inputBuf; inPtr = r - 1; } parseStart = oldp = *p; // remember where we begin