X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=dialogs.c;h=f39199771fcfd1145501c5708a6ecb1e03a373da;hb=f6e0ba4110818a2785aa480eaa05836b742e9992;hp=eecf453dbb75b8b9e4d67cbd85ae44ab8ab37a2b;hpb=544946411e3590e96198f8c3308418c4c456dd77;p=xboard.git diff --git a/dialogs.c b/dialogs.c index eecf453..f391997 100644 --- a/dialogs.c +++ b/dialogs.c @@ -1259,7 +1259,7 @@ NewTagsPopup (char *text, char *msg, char *ttl) if(tagsText) free(tagsText); tagsText = strdup(text); tagsOptions[0].name = msg; MarkMenu("View.Tags", TagsDlg); - GenericPopUp(tagsOptions, title, TagsDlg, BoardWindow, NONMODAL, appData.topLevel); + GenericPopUp(tagsOptions + (msg == NULL), title, TagsDlg, BoardWindow, NONMODAL, appData.topLevel); } void @@ -2467,8 +2467,8 @@ GetHelpText (FILE *f, char *name) while(buf[--len] == ' ') buf[len] = NULLCHAR; snprintf(title, MSG_SIZ, "Help on '%s'", buf+3); while((line = ReadLine(f))) { - if(!strncmp(line, buf, len) && (strncmp(line, ".SS ", 4) || strncmp(line+4, buf+3, len-3))) { - while((line = ReadLine(f)) && (cnt == 0 || strncmp(line, ".B ", 3))) { + if(!strncmp(line, buf, len) || !strncmp(line, ".SS ", 4) && !strncmp(line+4, buf+3, len-3)) { + while((line = ReadLine(f)) && (cnt == 0 || strncmp(line, ".B ", 3) && strncmp(line, ".SS ", 4))) { if(!*line) { *p++ = '\n'; *p++ = '\n'; q = p; continue; } if(*line == '.') continue; *p++ = ' '; cnt++; @@ -2491,8 +2491,17 @@ GetHelpText (FILE *f, char *name) void DisplayHelp (char *name) { - char *manFile = MANDIR "/man6/xboard.6"; - FILE *f = fopen(manFile, "r"); + char buf[MSG_SIZ], tidy[MSG_SIZ]; + FILE *f; + 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", tidy); + f = fopen(buf, "r"); + } if(f) { GetHelpText(f, name); fclose(f);