X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gamelist.c;h=a09ef64004f3cefd8ddeedae6a67870986a2cb6b;hb=7593c72477c93032e5cacf5df0faa424aa64913c;hp=0df36b6bf992c6c8bac31848ed13e1b7b4e38536;hpb=05bc30b15e31c427ce208495a889e9ff36e6642b;p=xboard.git diff --git a/gamelist.c b/gamelist.c index 0df36b6..a09ef64 100644 --- a/gamelist.c +++ b/gamelist.c @@ -157,9 +157,9 @@ int GameListBuild(f) gameNumber = 0; lastStart = (ChessMove) 0; - yyskipmoves = TRUE; + yyskipmoves = FALSE; do { - yyboardindex = 1; + yyboardindex = 0; offset = yyoffset(); cm = (ChessMove) yylex(); switch (cm) { @@ -222,6 +222,20 @@ int GameListBuild(f) } } while (cm == PGNTag || cm == Comment); break; + case NormalMove: + /* Allow the first game to start with an unnumbered move */ + yyskipmoves = TRUE; + if (lastStart == (ChessMove) 0) { + if ((error = GameListNewGame(¤tListGame))) { + rewind(f); + yyskipmoves = FALSE; + return(error); + } + currentListGame->number = ++gameNumber; + currentListGame->offset = offset; + lastStart = MoveNumberOne; + } + break; default: break; }