From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 46f72362 for ; Fri, 27 Jan 2017 08:59:58 -0500 (EST) Date: Fri, 27 Jan 2017 08:59:58 -0500 (EST) Message-Id: <16909011154899065915.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: merge rev. X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- merge rev. 1.239: fix base directory detection for makewhatis -t Tags: ---- VERSION_1_13 Modified Files: -------------- mdocml: mandocdb.c Revision Data ------------- Index: mandocdb.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/mandocdb.c,v retrieving revision 1.220.2.7 retrieving revision 1.220.2.8 diff -Lmandocdb.c -Lmandocdb.c -u -p -r1.220.2.7 -r1.220.2.8 --- mandocdb.c +++ mandocdb.c @@ -908,6 +908,20 @@ filescan(const char *file) } /* + * In test mode or when the original name is absolute + * but outside our tree, guess the base directory. + */ + + if (op == OP_TEST || (start == buf && *start == '/')) { + if (strncmp(buf, "man/", 4) == 0) + start = buf + 4; + else if ((start = strstr(buf, "/man/")) != NULL) + start += 5; + else + start = buf; + } + + /* * First try to guess our directory structure. * If we find a separator, try to look for man* or cat*. * If we find one of these and what's underneath is a directory, -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv