diff options
author | Colin Watson <cjwatson@debian.org> | 2022-09-24 22:40:25 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2022-09-24 22:40:25 +0100 |
commit | e9bb7b74219eed74e61803994da901aa82cb85fd (patch) | |
tree | e046e8d37640bd257026ecc7c32b71ffadbe5544 | |
parent | 9aff3c30b042b322701f3f659d42c62635280758 (diff) |
Fix section/extension for links in database
In some cases this resulted in spurious database entries. For example,
if `man5/inetd.conf.5` was a symlink to `man8/inetd.8` and that page had
a `NAME` entry for `inetd`, then as well as entries for `inetd` in
section 8 and `inetd.conf` in section 5, we would also store a spurious
entry for `inetd` in section 5. We no longer do that.
* src/descriptions_store.c (store_descriptions): For names corresponding
to entries in the ultimate source trace and not to the base name of the
file, use the section and extension of the trace entry rather than of
the ultimate source.
-rw-r--r-- | NEWS.md | 2 | ||||
-rw-r--r-- | src/descriptions_store.c | 4 |
2 files changed, 6 insertions, 0 deletions
@@ -11,6 +11,8 @@ Fixes: * Database entries for links were often incorrectly stored as if they were entries for the ultimate source of the page. They are now stored with the correct type. + * Store links in the database using the section and extension of the link + rather than of the ultimate source file. Improvements: diff --git a/src/descriptions_store.c b/src/descriptions_store.c index d0d23441..2425d1b5 100644 --- a/src/descriptions_store.c +++ b/src/descriptions_store.c @@ -133,6 +133,10 @@ void store_descriptions (MYDBM_FILE dbf, gl_list_t descs, struct mandata *info, free_mandata_struct (trace_info); break; } + free (whatis_info->ext); + whatis_info->ext = xstrdup (trace_info->ext); + free (whatis_info->sec); + whatis_info->sec = xstrdup (trace_info->sec); if (!gl_list_next_node (trace, trace_node)) { if (info->id == SO_MAN) whatis_info->id = ULT_MAN; |