From ff4d3da52f0a87b09de3f49f0512d9994c40b048 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Tue, 11 Nov 2014 14:40:43 +0100 Subject: [PATCH] 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. --- dialogs.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) 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 -- 1.7.0.4