summaryrefslogtreecommitdiffstats
path: root/mandocdb.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-02-27 16:22:09 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-02-27 16:22:09 +0000
commit9db529ea6c2a10761e905b75074060e913316170 (patch)
tree7c18fae73cc16eac8cc7d8219972861a1fe21255 /mandocdb.c
parent1a83fe0518c070d90a4989d137927b786a7732d4 (diff)
downloadmandoc-9db529ea6c2a10761e905b75074060e913316170.tar.gz
When makewhatis(8) scans a tree, ignore trailing garbage on filenames.
This is relevant because some ports install files like man1/xsel.1x, as reported by patrick keshishian <pkeshish at gmail dot com> on misc@. We can probably improve functionality and simplify the code by ignoring file name extensions altogether; we already know the section number from the name of the directory. But so close to lock, i'm keeping the fix minimal.
Diffstat (limited to 'mandocdb.c')
-rw-r--r--mandocdb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mandocdb.c b/mandocdb.c
index d14cb0f3..f9af88d0 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -672,7 +672,8 @@ treescan(void)
say(path, "Skip pdf");
continue;
} else if ( ! use_all &&
- ((FORM_SRC == dform && strcmp(fsec, dsec)) ||
+ ((FORM_SRC == dform &&
+ strncmp(fsec, dsec, strlen(dsec))) ||
(FORM_CAT == dform && strcmp(fsec, "0")))) {
if (warnings)
say(path, "Wrong filename suffix");