Skip to content

Commit

Permalink
tools/check-bolt: don't get confused by 'BOLT #1' in middle of a comm…
Browse files Browse the repository at this point in the history
…ent.

Insist it be prefixed with '* '.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell authored and niftynei committed Sep 10, 2019
1 parent e52af0d commit 51d7a14
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/check-bolt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)++;
Expand Down

0 comments on commit 51d7a14

Please sign in to comment.