summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2022-09-24 21:57:31 +0100
committerColin Watson <cjwatson@debian.org>2022-09-24 21:57:31 +0100
commit9c51116618af4c9f6a2537df6ea22c5deeefc496 (patch)
tree89ddd41ffc100fbaaddb9bae6239f76de4d539de
parentb1615c44fe20c205be2b5ba5cd95e0cc8510d766 (diff)
Fix stored ID for links
Database entries for links were often incorrectly stored as `ULT_MAN`, depending on the exact order in which pages were scanned. They are now stored more consistently as `SO_MAN`. * src/descriptions_store.c (store_descriptions): Override the ID from `ULT_MAN` to `SO_MAN` if the name is not the last entry in the trace. (Previously we overrode from `SO_MAN` to `ULT_MAN` if the name was the last entry in the trace, but not the converse.) * NEWS.md: Document this.
-rw-r--r--NEWS.md3
-rw-r--r--src/descriptions_store.c13
2 files changed, 11 insertions, 5 deletions
diff --git a/NEWS.md b/NEWS.md
index 332da3cf..c27cdab6 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -8,6 +8,9 @@ Fixes:
* Upgrade Gnulib, fixing syntax error on glibc systems with GCC 11.
* The `CATWIDTH` configuration file directive now overrides `MINCATWIDTH`
and `MAXCATWIDTH`.
+ * 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.
Improvements:
diff --git a/src/descriptions_store.c b/src/descriptions_store.c
index 69e2cd37..16129d99 100644
--- a/src/descriptions_store.c
+++ b/src/descriptions_store.c
@@ -122,11 +122,14 @@ void store_descriptions (MYDBM_FILE dbf, gl_list_t descs, struct mandata *info,
free_mandata_struct (trace_info);
break;
}
- if (!gl_list_next_node (trace, trace_node) &&
- save_id == SO_MAN)
- info->id = ULT_MAN;
- else
- info->id = save_id;
+ info->id = save_id;
+ if (!gl_list_next_node (trace, trace_node)) {
+ if (save_id == SO_MAN)
+ info->id = ULT_MAN;
+ } else {
+ if (save_id == ULT_MAN)
+ info->id = SO_MAN;
+ }
free (info->pointer);
info->pointer = NULL;
free (info->whatis);