X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=blobdiff_plain;f=parser.c;h=4c634ca3a6a5e139ec317bb063e5a7dda92796f2;hp=c2eda2b25422e4de0591a23359a6441ac6b2bf9c;hb=ebf8f690dfc868c231baacd2232840e14586d00f;hpb=af3d528cf16eae800ff7f0b8b62f77ced7493412 diff --git a/parser.c b/parser.c index c2eda2b..4c634ca 100644 --- a/parser.c +++ b/parser.c @@ -285,7 +285,7 @@ KifuMove (char **p) int ReadLine () { // Read one line from the input file, and append to the buffer - char c, *start = inPtr; + int c; char *start = inPtr; if(fromString) return 0; // parsing string, so the end is a hard end if(!inputFile) return 0; while((c = fgetc(inputFile)) != EOF) { @@ -404,7 +404,7 @@ NextUnit (char **p) if(**p == NULLCHAR) { // make sure there is something to parse if(fromString) return 0; // we are parsing string, so the end is really the end - *p = inPtr = inputBuf; + *p = inPtr = parseStart = inputBuf; if(!ReadLine()) return 0; // EOF } else if(inPtr > inputBuf + PARSEBUFSIZE/2) { // buffer fills up with already parsed stuff char *q = *p, *r = inputBuf; @@ -585,7 +585,7 @@ NextUnit (char **p) if(killX < 0) // [HGM] lion: do not overwrite kill-square suffix currentMoveString[4] = cl.promoChar; - if((cl.kind == WhiteCapturesEnPassant || cl.kind == BlackCapturesEnPassant) && (Match("ep", p) || Match("e.p.", p))); + if((cl.kind == WhiteCapturesEnPassant || cl.kind == BlackCapturesEnPassant) && !Match("ep", p)) Match("e.p.", p); return (int) cl.kind; }