/*
* gamelist.c -- Functions to manage a gamelist
- * XBoard $Id$
+ * XBoard $Id: gamelist.c,v 2.1 2003/10/27 19:21:00 mann Exp $
*
* Copyright 1995 Free Software Foundation, Inc.
*
gameNumber = 0;
lastStart = (ChessMove) 0;
- yyskipmoves = TRUE;
+ yyskipmoves = FALSE;
do {
- yyboardindex = 1;
+ yyboardindex = 0;
offset = yyoffset();
cm = (ChessMove) yylex();
switch (cm) {
}
} 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;
}