- for (deps = get_deps(*file, *file); *deps; deps++) {
- if (streq(*deps, base))
+ for (deps = get_deps(*file, talloc_dirname(*file, *file),
+ talloc_basename(*file, *file), false, NULL);
+ *deps; deps++) {
+ if (!strstarts(*deps, "ccan/"))
+ continue;
+ if (streq(*deps + strlen("ccan/"), base))