summaryrefslogtreecommitdiff
path: root/tools/ccanlint/file_analysis.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-01-13 19:25:01 +1030
committerRusty Russell <rusty@rustcorp.com.au>2011-01-13 19:25:01 +1030
commit23e4603462692031a29ea4b2a882f957de4f2922 (patch)
treee004ddcf4a4f8533e898633ed90cbeeefcce28e7 /tools/ccanlint/file_analysis.c
parent6156d1ab34b93c1e66473120df339fb23b08196a (diff)
htable: fix type of cmpfn in htable_type
It in fact takes an object and a key to compare, not two keys. The test case had the key as first element of the object, so it worked, but ccanlint lost track of module dependencies due to this bug, and thus would build submodules multiple times.
Diffstat (limited to 'tools/ccanlint/file_analysis.c')
-rw-r--r--tools/ccanlint/file_analysis.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/ccanlint/file_analysis.c b/tools/ccanlint/file_analysis.c
index 7b2565a9..14b2631e 100644
--- a/tools/ccanlint/file_analysis.c
+++ b/tools/ccanlint/file_analysis.c
@@ -33,9 +33,9 @@ static const char *manifest_name(const struct manifest *m)
return m->dir;
}
-static bool dir_cmp(const char *dir1, const char *dir2)
+static bool dir_cmp(const struct manifest *m, const char *dir)
{
- return strcmp(dir1, dir2) == 0;
+ return strcmp(m->dir, dir) == 0;
}
HTABLE_DEFINE_TYPE(struct manifest, manifest_name, dir_hash, dir_cmp, manifest);