From e5fcfee6ac8d8caa96337ae9c17562e7d5c03c11 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Wed, 23 Mar 2016 20:25:40 +0100 Subject: [PATCH] Allow help-clicks on Label Options with linefeeds Some of the LabelOptions in dialogs do have linefeeds. (In particular, those in the Load Options dialog.) So we allow help clicks on them, but add linefeed with the termination characters. Except that a leading linefeed will be clipped off. --- dialogs.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dialogs.c b/dialogs.c index 45acd30..7ca879f 100644 --- a/dialogs.c +++ b/dialogs.c @@ -2476,9 +2476,10 @@ GetHelpText (FILE *f, char *name) { char *line, buf[MSG_SIZ], title[MSG_SIZ], text[10000], *p = text, *q = text; int len, cnt = 0; + while(*name == '\n') name++; snprintf(buf, MSG_SIZ, ".B %s", name); len = strlen(buf); - for(len=3; buf[len] && buf[len] != '(' && buf[len] != ':' && buf[len] != '.' && buf[len] != '?'; len++); + for(len=3; buf[len] && buf[len] != '(' && buf[len] != ':' && buf[len] != '.' && buf[len] != '?' && buf[len] != '\n'; len++); buf[len] = NULLCHAR; while(buf[--len] == ' ') buf[len] = NULLCHAR; snprintf(title, MSG_SIZ, "Help on '%s'", buf+3); -- 1.7.0.4