From: H.G.Muller Date: Mon, 2 Mar 2015 11:04:58 +0000 (+0100) Subject: Use PGN result in Game List build to supply tag X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=a76c5b5396181c0c45a02455a5515c1fe2009786;p=xboard.git Use PGN result in Game List build to supply tag If a PGN tag was missing (as in loading of non-PGN game collections) the game would be marked as unfinished ('*') in the Game List, even when it contained a result. The kif-format resign messages are now cast in a form that also recognizes the result-detail message. --- diff --git a/gamelist.c b/gamelist.c index a6c688c..8976164 100644 --- a/gamelist.c +++ b/gamelist.c @@ -359,6 +359,8 @@ GameListBuild (FILE *f) case GameIsDrawn: case GameUnfinished: if(!currentListGame) break; + if(currentListGame->gameInfo.result == GameUnfinished) + currentListGame->gameInfo.result = cm; // correct result tag with actual result if (currentListGame->gameInfo.resultDetails != NULL) { free(currentListGame->gameInfo.resultDetails); } diff --git a/parser.c b/parser.c index f0279d8..c997ccd 100644 --- a/parser.c +++ b/parser.c @@ -228,8 +228,8 @@ KifuMove (char **p) int res; parseStart = yytext; if(wom) - res = BlackWins, strcpy(yytext, "0-1 {resign}"); - else res = WhiteWins, strcpy(yytext, "1-0 {resign}"); + res = BlackWins, strcpy(yytext, "{sente resigns} 0-1"); + else res = WhiteWins, strcpy(yytext, "{gote resigns} 1-0"); return res; } else { while(**p && **p != '\n') (*p)++; // unrecognized Japanese kanji: skip to end of line