From 9db529ea6c2a10761e905b75074060e913316170 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 27 Feb 2015 16:22:09 +0000 Subject: 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 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. --- mandocdb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mandocdb.c') 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"); -- cgit