X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gamelist.c;h=a36af7ad0db9cd883556f872e0597838747142fa;hb=09d925e8732793829e2a2a2abe582a46343e3fd2;hp=07619f20d873b0db8412549825ed807f8437106f;hpb=0ea1b434ac6becf79c75d85ba27de5b89666a7c3;p=xboard.git diff --git a/gamelist.c b/gamelist.c index 07619f2..a36af7a 100644 --- a/gamelist.c +++ b/gamelist.c @@ -1,7 +1,7 @@ /* * gamelist.c -- Functions to manage a gamelist * - * Copyright 1995, 2009, 2010 Free Software Foundation, Inc. + * Copyright 1995, 2009, 2010, 2011 Free Software Foundation, Inc. * * Enhancements Copyright 2005 Alessandro Scotti * @@ -214,7 +214,7 @@ int GameListBuild(f) ListGame *currentListGame = NULL; int error; int offset; - char lastComment[MSG_SIZ]; + char lastComment[MSG_SIZ], buf[MSG_SIZ]; GameListFree(&gameList); yynewfile(f); @@ -225,7 +225,7 @@ int GameListBuild(f) do { yyboardindex = 0; offset = yyoffset(); - cm = (ChessMove) yylex(); + cm = (ChessMove) Myylex(); switch (cm) { case GNUChessGame: if ((error = GameListNewGame(¤tListGame))) { @@ -280,7 +280,7 @@ int GameListBuild(f) do { yyboardindex = 1; offset = yyoffset(); - cm = (ChessMove) yylex(); + cm = (ChessMove) Myylex(); if (cm == PGNTag) { ParsePGNTag(yy_text, ¤tListGame->gameInfo); } @@ -304,6 +304,7 @@ int GameListBuild(f) case BlackWins: case GameIsDrawn: case GameUnfinished: + if(!currentListGame) break; if (currentListGame->gameInfo.resultDetails != NULL) { free(currentListGame->gameInfo.resultDetails); } @@ -316,10 +317,13 @@ int GameListBuild(f) default: break; } + if(gameNumber % 1000 == 0) { + snprintf(buf, MSG_SIZ,"Reading game file (%d)", gameNumber); + DisplayTitle(buf); + } } while (cm != (ChessMove) 0); - if (appData.debugMode) { for (currentListGame = (ListGame *) gameList.head; currentListGame->node.succ; @@ -331,6 +335,7 @@ int GameListBuild(f) } } + DisplayTitle("WinBoard"); rewind(f); yyskipmoves = FALSE; return 0; @@ -435,7 +440,7 @@ char * GameListLine( int number, GameInfo * gameInfo ) break; case GLT_WHITE_ELO: if( gameInfo->whiteRating > 0 ) - sprintf( buf, "%d", gameInfo->whiteRating ); + sprintf( buf, "%d", gameInfo->whiteRating ); else safeStrCpy( buf, "?" , 2*MSG_SIZ); break; @@ -496,7 +501,6 @@ char * GameListLineFull( int number, GameInfo * gameInfo ) return ret; } - // --------------------------------------- Game-List options dialog -------------------------------------- // back-end