From 980360ccfb8ca60f0fa8a846da6b461f0c48f9e0 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Sat, 12 Mar 2016 16:51:44 +0100 Subject: [PATCH] Make help clicks also work for UCI engines The help clicks were using the engine command to find the manual, but this would not work for engines with parameters or using adapters. Now it used the -fcp/scp arguments, and tidies these to stripp off directory path and arguments. (cps->tidy could not be used, because it is overwritten by the name reported by the engine itself, which usually contains version numbers not in the manual name.) --- dialogs.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dialogs.c b/dialogs.c index 2be171f..f391997 100644 --- a/dialogs.c +++ b/dialogs.c @@ -2491,14 +2491,16 @@ GetHelpText (FILE *f, char *name) void DisplayHelp (char *name) { - char buf[MSG_SIZ]; + char buf[MSG_SIZ], tidy[MSG_SIZ]; FILE *f; - if(currentCps) snprintf(buf, MSG_SIZ, "/usr/local/share/man/man6/%s.6", currentCps->program); - else snprintf(buf, MSG_SIZ, "%s/man6/xboard.6", MANDIR); + if(currentCps) { + TidyProgramName(currentCps == &first ? appData.firstChessProgram : appData.secondChessProgram, "localhost", tidy); + snprintf(buf, MSG_SIZ, "/usr/local/share/man/man6/%s.6", tidy); + } else snprintf(buf, MSG_SIZ, "%s/man6/xboard.6", MANDIR); f = fopen(buf, "r"); if(!f && currentCps) { // engine manual could be in two places - snprintf(buf, MSG_SIZ, "/usr/share/man/man6/%s.6", currentCps->program); - f= fopen(buf, "r"); + snprintf(buf, MSG_SIZ, "/usr/share/man/man6/%s.6", tidy); + f = fopen(buf, "r"); } if(f) { GetHelpText(f, name); -- 1.7.0.4