- char *p;
- if (lines[i][strspn(lines[i], " \t")] != '#')
- continue;
- p = strip_spaces(f, lines[i]);
- if (!strstarts(p, "#include<ccan/")
- && !strstarts(p, "#include\"ccan/"))
- continue;
- p += strlen("#include\"ccan/");
- if (!strchr(strchr(p, '/') + 1, '/'))
+ char *mod;
+ if (!strreg(f, lines[i],
+ "^[ \t]*#[ \t]*include[ \t]*[<\"]"
+ "ccan/+([^/]+)/", &mod))