- mod = *lines + preflen + strlen("#include <ccan/");
- modlen = strcspn(mod, "/");
- mod = talloc_strndup(f, mod, modlen);
- list = add_dep(m, list, mod);
+ modname = talloc_strdup(f, *lines + preflen
+ + strlen("#include <ccan/"));
+ modname[strcspn(modname, "/")] = '\0';
+ if (!have_mod(deps, modname))
+ add_dep(&deps, modname);