summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2022-10-01 22:21:42 +0100
committerColin Watson <cjwatson@debian.org>2022-10-01 22:21:42 +0100
commit46a37c0736943f63270de92bc5c3888d88b3220f (patch)
tree22090520574854aadee606a68ba065532530b9d8
parentd3e4b5522ae8152f10db0bb98e6873c9cc17ed59 (diff)
test_manfile: Stop caching ult_src traces
Now that `test_manfile` always calls `ult_src` before adding database entries, there's no need for it to cache the resulting traces, and doing so had some confusing consequences since `store_descriptions` could end up seeing cached traces that didn't include the initial path. * src/check_mandirs.c (struct whatis): Remove `trace` element. (whatis_free): Stop freeing `whatis->trace`. (test_manfile): Stop caching `ult->trace`; pass it directly to `store_descriptions` instead.
-rw-r--r--src/check_mandirs.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/check_mandirs.c b/src/check_mandirs.c
index 507021b0..3e4e5464 100644
--- a/src/check_mandirs.c
+++ b/src/check_mandirs.c
@@ -90,7 +90,6 @@ gl_map_t whatis_map = NULL;
struct whatis {
char *whatis;
char *filters;
- gl_list_t trace;
};
static void whatis_free (const void *value)
@@ -99,7 +98,6 @@ static void whatis_free (const void *value)
free (whatis->whatis);
free (whatis->filters);
- gl_list_free (whatis->trace);
free (whatis);
}
@@ -296,9 +294,7 @@ void test_manfile (MYDBM_FILE dbf, const char *file, const char *path)
new_whatis = XMALLOC (struct whatis);
new_whatis->whatis = lg.whatis ? xstrdup (lg.whatis) : NULL;
new_whatis->filters = lg.filters ? xstrdup (lg.filters) : NULL;
- new_whatis->trace = ult->trace;
gl_map_put (whatis_map, xstrdup (ult->path), new_whatis);
- whatis = new_whatis;
}
debug ("\"%s\"\n", lg.whatis);
@@ -310,7 +306,7 @@ void test_manfile (MYDBM_FILE dbf, const char *file, const char *path)
gl_list_t descs = parse_descriptions (manpage_base, lg.whatis);
if (!opt_test)
store_descriptions (dbf, descs, info, path,
- manpage_base, whatis->trace);
+ manpage_base, ult->trace);
gl_list_free (descs);
} else if (quiet < 2) {
(void) stat (ult->path, &buf);