From: H.G.Muller Date: Wed, 23 Mar 2016 19:25:40 +0000 (+0100) Subject: Allow help-clicks on Label Options with linefeeds X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=e5fcfee6ac8d8caa96337ae9c17562e7d5c03c11;p=xboard.git 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. --- 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);