From: H.G.Muller Date: Tue, 11 Nov 2014 13:40:43 +0000 (+0100) Subject: Fix crash on using Browse buttons in Tournament dialog Xaw X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=ff4d3da52f0a87b09de3f49f0512d9994c40b048;p=xboard.git Fix crash on using Browse buttons in Tournament dialog Xaw The Xaw file browser assumes the text entries it is browsing for are all in dialogs of the class TransienDlg, but the Tournament Options dialog has been altered to MasterDlg, to allow it to co-exist with Time Control and Common-Engine dialog (which can be opened through buttons in it). Xaw did not like that, and the true DialogClass is now used when setting the widget text. --- diff --git a/dialogs.c b/dialogs.c index 45209e6..2e63442 100644 --- a/dialogs.c +++ b/dialogs.c @@ -2724,6 +2724,7 @@ DisplayMessage (char *message, char *extMessage) #define MAXFILES 1000 +static DialogClass savDlg; static ChessProgramState *savCps; static FILE **savFP; static char *fileName, *extFilter, *savMode, **namePtr; @@ -2806,7 +2807,7 @@ BrowseOK (int n) snprintf(title, MSG_SIZ, "%s", fileName); else snprintf(title, MSG_SIZ, "%s/%s", curDir, fileName); - SetWidgetText((Option*) savFP, title, TransientDlg); + SetWidgetText((Option*) savFP, title, savDlg); currentCps = savCps; // could return to Engine Settings dialog! return TRUE; } @@ -2963,7 +2964,7 @@ void Browse (DialogClass dlg, char *label, char *proposed, char *ext, Boolean pathFlag, char *mode, char **name, FILE **fp) { int j=0; - savFP = fp; savMode = mode, namePtr = name, savCps = currentCps, oldVal = values[9]; // save params, for use in callback + savFP = fp; savMode = mode, namePtr = name, savCps = currentCps, oldVal = values[9], savDlg = dlg; // save params, for use in callback ASSIGN(extFilter, ext); ASSIGN(fileName, proposed ? proposed : ""); for(j=0; Extensions[j]; j++) // look up actual value in list of possible values, to get selection nr