tools/check-bolt: don't get confused by 'BOLT #1' in middle of a comment.

Insist it be prefixed with '* '.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2019-09-10 11:48:27 +09:30 committed by neil saitug
parent e52af0d1ea
commit 51d7a1404f

View File

@ -102,9 +102,14 @@ static char *find_bolt_ref(const char *prefix, char **p, size_t *len)
size_t preflen; size_t preflen;
/* BOLT #X: */ /* BOLT #X: */
*p = strstr(*p, prefix); *p = strchr(*p, '*');
if (!*p) if (!*p)
return NULL; return NULL;
*p += 1;
while (cisspace(**p))
(*p)++;
if (strncmp(*p, prefix, strlen(prefix)) != 0)
continue;
*p += strlen(prefix); *p += strlen(prefix);
while (cisspace(**p)) while (cisspace(**p))
(*p)++; (*p)++;