aboutsummaryrefslogtreecommitdiffstatshomepage
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
commite14bca4c9bbeb7cad3aa999d589e1fc15542b414 (patch)
tree93f7cdacf724812099a699308fc4601d28f9260a
parent2c9a9ce612c2c9524d33f9cc6c55301eef91b9db (diff)
downloadmandoc-e14bca4c9bbeb7cad3aa999d589e1fc15542b414.tar.gz
mandoc-e14bca4c9bbeb7cad3aa999d589e1fc15542b414.tar.zst
mandoc-e14bca4c9bbeb7cad3aa999d589e1fc15542b414.zip
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.
-rw-r--r--mandocdb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 6ae390be..9270e5cd 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.184 2015/01/21 22:41:49 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.185 2015/02/27 16:22:09 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -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");