Skip to content

Commit 51d7a14

Browse files
rustyrussellniftynei
authored andcommitted
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>
1 parent e52af0d commit 51d7a14

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/check-bolt.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,14 @@ static char *find_bolt_ref(const char *prefix, char **p, size_t *len)
102102
size_t preflen;
103103

104104
/* BOLT #X: */
105-
*p = strstr(*p, prefix);
105+
*p = strchr(*p, '*');
106106
if (!*p)
107107
return NULL;
108+
*p += 1;
109+
while (cisspace(**p))
110+
(*p)++;
111+
if (strncmp(*p, prefix, strlen(prefix)) != 0)
112+
continue;
108113
*p += strlen(prefix);
109114
while (cisspace(**p))
110115
(*p)++;

0 commit comments

Comments
 (0)