From 51d7a1404fb45a4748c380ea78be77cea22df385 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 10 Sep 2019 11:48:27 +0930 Subject: [PATCH] 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 --- tools/check-bolt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/check-bolt.c b/tools/check-bolt.c index dd1c7ae84..59bbf5c20 100644 --- a/tools/check-bolt.c +++ b/tools/check-bolt.c @@ -102,9 +102,14 @@ static char *find_bolt_ref(const char *prefix, char **p, size_t *len) size_t preflen; /* BOLT #X: */ - *p = strstr(*p, prefix); + *p = strchr(*p, '*'); if (!*p) return NULL; + *p += 1; + while (cisspace(**p)) + (*p)++; + if (strncmp(*p, prefix, strlen(prefix)) != 0) + continue; *p += strlen(prefix); while (cisspace(**p)) (*p)++;