summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2023-01-01 23:16:58 +0000
committerColin Watson <cjwatson@debian.org>2023-01-01 23:16:58 +0000
commit89e58c82e73db5c9dd337b015c76cd49ccbce1d1 (patch)
tree56a0577128ea035ea626616875be62950cb21b52
parentbc2573614d40ccf457991223d6727e29486621f4 (diff)
mandb: Check for stray cats even if the manpath is unchanged
* src/mandb.c (mandb): Require the database file to be open before calling `straycats`, but don't require `create_db` or `update_db_wrapper` to have made any changes to it. * src/tests/mandb-whatis-broken-link-changes: Update expected output. * NEWS.md: Document this.
-rw-r--r--NEWS.md5
-rw-r--r--src/mandb.c2
-rwxr-xr-xsrc/tests/mandb-whatis-broken-link-changes1
3 files changed, 7 insertions, 1 deletions
diff --git a/NEWS.md b/NEWS.md
index 724090ab..91648d8f 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -7,6 +7,11 @@ Fixes:
* Fix segfault in typical uses of `man` when `nroff` is not installed.
* Fix crash in `mandb` when processing stray cats.
+Improvements:
+
+ * Check for stray cats even if no manual pages in a given manpath were
+ changed.
+
man-db 2.11.1 (15 November 2022)
================================
diff --git a/src/mandb.c b/src/mandb.c
index 751f942e..e62085ea 100644
--- a/src/mandb.c
+++ b/src/mandb.c
@@ -629,7 +629,7 @@ static int mandb (struct dbpaths *dbpaths,
else
amount = update_db_wrapper (dbf, manpath, catpath);
- if (check_for_strays && amount > 0)
+ if (check_for_strays && dbf->file)
strays += straycats (dbf, manpath);
MYDBM_FREE (dbf);
diff --git a/src/tests/mandb-whatis-broken-link-changes b/src/tests/mandb-whatis-broken-link-changes
index 7039ab98..2facd5d7 100755
--- a/src/tests/mandb-whatis-broken-link-changes
+++ b/src/tests/mandb-whatis-broken-link-changes
@@ -45,6 +45,7 @@ LC_ALL=C run $MANDB -C "$tmpdir/manpath.config" -u \
cat >"$tmpdir/3.exp" <<EOF
Purging old database entries in $abstmpdir/usr/share/man...
Processing manual pages under $abstmpdir/usr/share/man...
+Checking for stray cats under $abstmpdir/usr/share/man...
Processing manual pages under $abstmpdir/usr/share/man/cat1...
0 man subdirectories contained newer manual pages.
0 manual pages were added.