From fcf1b04ac104178d84c30b2824804f199061e250 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Tue, 29 Mar 2016 21:20:51 +0200 Subject: [PATCH] Fix help search The help search was ignoring the last character of the searched string. Which almost neven mattered, except when the searched string was only 1 or 2 characters, like for the buttons in the button bar. --- dialogs.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dialogs.c b/dialogs.c index 84ac446..19b69af 100644 --- a/dialogs.c +++ b/dialogs.c @@ -2484,8 +2484,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) - || !strncmp(line, ".IX Item \"", 10) && !strncmp(line+10, buf+3, len-3)) { + if(!strncmp(line, buf, ++len) || !strncmp(line, ".SS ", 4) && !strncmp(line+4, buf+3, len-3) + || !strncmp(line, ".IX Item \"", 10) && !strncmp(line+10, buf+3, len-3)) { while((line = ReadLine(f)) && (cnt == 0 || strncmp(line, ".B ", 3) && strncmp(line, ".SS ", 4) && strncmp(line, ".IX ", 4))) { if(!*line) { *p++ = '\n'; *p++ = '\n'; q = p; continue; } if(*line == '.') continue; -- 1.7.0.4