From: H.G. Muller Date: Fri, 6 May 2011 16:15:23 +0000 (+0200) Subject: Fix exit popup in tourney mode X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=085982e238267d18e0c6b192ca25a7b998631a42;p=xboard.git Fix exit popup in tourney mode Only the instance finishing the last tourney game will cause a popup with final standings. As long as there are still busy games, it exits or switches back to idle mode silently. --- diff --git a/backend.c b/backend.c index 69b79e5..9204e1b 100644 --- a/backend.c +++ b/backend.c @@ -7085,7 +7085,7 @@ TourneyStandings(int display) case '-': bScore = 2; break; case '=': wScore = bScore = 1; break; case ' ': - case '*': return NULL; // tourney not finished + case '*': return strdup("busy"); // tourney not finished } score[w] += wScore; score[b] += bScore; @@ -10064,9 +10064,16 @@ GameEnds(result, resultDetails, whosays) ModeHighlight(); endingGame = 0; /* [HGM] crash */ if(popupRequested) { // [HGM] crash: this calls GameEnds recursively through ExitEvent! Make it a harmless tail recursion. - if(matchMode == TRUE) DisplayFatalError(ranking ? ranking : buf, 0, 0); else { - matchMode = FALSE; appData.matchGames = matchGame = roundNr = 0; - DisplayNote(ranking ? ranking : buf); + if(matchMode == TRUE) { // match through command line: exit with or without popup + if(ranking) { + if(strcmp(ranking, "busy")) DisplayFatalError(ranking, 0, 0); + else ExitEvent(0); + } else DisplayFatalError(buf, 0, 0); + } else { // match through menu; just stop, with or without popup + matchMode = FALSE; appData.matchGames = matchGame = roundNr = 0; + if(ranking){ + if(strcmp(ranking, "busy")) DisplayNote(ranking); + } else DisplayNote(buf); } if(ranking) free(ranking); }