From: H.G. Muller Date: Sun, 27 Sep 2009 19:10:38 +0000 (-0700) Subject: added the result comment to the game-list tags when the game list is exported to... X-Git-Tag: v4.4.1.20091019~78 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=13e03bda5c89c4457bc599bae34110b6bc76aba5;p=xboard.git added the result comment to the game-list tags when the game list is exported to the clipboard --- diff --git a/gamelist.c b/gamelist.c index 0a4979e..7775a99 100644 --- a/gamelist.c +++ b/gamelist.c @@ -343,7 +343,7 @@ GameListLineOld(number, gameInfo) return ret; } -#define MAX_FIELD_LEN 64 /* To avoid overflowing the buffer */ +#define MAX_FIELD_LEN 80 /* To avoid overflowing the buffer */ char * GameListLine( int number, GameInfo * gameInfo ) { @@ -431,12 +431,14 @@ char * GameListLineFull( int number, GameInfo * gameInfo ) char * round = gameInfo->round ? gameInfo->round : "?"; char * date = gameInfo->date ? gameInfo->date : "?"; char * oob = gameInfo->outOfBook ? gameInfo->outOfBook : ""; + char * reason = gameInfo->resultDetails ? gameInfo->resultDetails : ""; - int len = 64 + strlen(event) + strlen(site) + strlen(white) + strlen(black) + strlen(date) + strlen(oob); + int len = 64 + strlen(event) + strlen(site) + strlen(white) + strlen(black) + strlen(date) + strlen(oob) + strlen(reason); char *ret = (char *) malloc(len); - sprintf(ret, "%d, \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\"", number, event, site, round, white, black, PGNResult(gameInfo->result), date, oob ); + sprintf(ret, "%d, \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\"", + number, event, site, round, white, black, PGNResult(gameInfo->result), reason, date, oob ); return ret; }