From: H.G.Muller Date: Fri, 11 Mar 2016 15:59:41 +0000 (+0100) Subject: Fix recognition of .SS lines in manual X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=9d32c01d675cb8e6a95a9492b1d9eb274653e1ca Fix recognition of .SS lines in manual The logic for recognizing .SS headers was reversed, and .SS lines were also not tested for to decide whether display should end. --- diff --git a/dialogs.c b/dialogs.c index eecf453..6ecdcaf 100644 --- a/dialogs.c +++ b/dialogs.c @@ -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++;