X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=parser.c;h=8b1dc3f1c69da56b8302b9c3f6bfde736c8cdc91;hb=475bba1329094bb261b1017251900883c31b0f5c;hp=6da13d40b7c73700ee52e2de2dabbe149e928ed4;hpb=0f1e3acd9ec3e283afe4bc1bf31f3fb8782611d3;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