X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=parser.l;h=77837a7b6e2068eec9f8bd117872555d400a35ea;hb=7b4dacf6fe9f8c10b6eb4d6070869a3d933dbeb5;hp=29a2fa944bd6f13a7dfb35ccc177fee7df73d083;hpb=cf8ee83ef1cee354cad4503b242f724abac1fe68;p=xboard.git diff --git a/parser.l b/parser.l index 29a2fa9..77837a7 100755 --- a/parser.l +++ b/parser.l @@ -7,7 +7,6 @@ %{ /* * parser.l -- lex parser of algebraic chess moves for XBoard - * $Id: parser.l,v 2.1 2003/10/27 19:21:00 mann Exp $ * * Copyright 1991 by Digital Equipment Corporation, Maynard, * Massachusetts. Enhancements Copyright @@ -470,9 +469,13 @@ extern void CopyBoard P((Board to, Board from)); if (WhiteOnMove(yyboardindex)) { if (yytext[2+skip] == ONE) return (int) ImpossibleMove; currentMoveString[1] = yytext[2+skip] - 1; + if(boards[yyboardindex][currentMoveString[1]-ONE][currentMoveString[0]-AAA] != WhitePawn) + return ImpossibleMove; } else { currentMoveString[1] = currentMoveString[3] + 1; if (currentMoveString[3] == ONE+BOARD_HEIGHT-1) return (int) ImpossibleMove; + if(boards[yyboardindex][currentMoveString[1]-ONE][currentMoveString[0]-AAA] != BlackPawn) + return ImpossibleMove; } if (yyleng-skip > 3) { if (yytext[yyleng-1] == ')')