From e14bca4c9bbeb7cad3aa999d589e1fc15542b414 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 | 5 +++-- 1 file 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 * Copyright (c) 2011-2015 Ingo Schwarze @@ -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 v1.2.3-56-ge451