summaryrefslogtreecommitdiffstats
path: root/mandocdb.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-01-21 22:41:49 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-01-21 22:41:49 +0000
commitf22d56f1242caf44fa20a85da0d9829b086bd965 (patch)
treedbedde39755eec44a799533549365db46a70e132 /mandocdb.c
parent1f42b16d7620434847b937d82a463bd7cbe63255 (diff)
downloadmandoc-f22d56f1242caf44fa20a85da0d9829b086bd965.tar.gz
Support homebrew-style linking on Mac OS X.
Idea found together with Alexis Hildebrandt <surryhill at gmail dot com>.
Diffstat (limited to 'mandocdb.c')
-rw-r--r--mandocdb.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/mandocdb.c b/mandocdb.c
index dd5fa488..d14cb0f3 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -613,7 +613,11 @@ treescan(void)
say(path, "&realpath");
continue;
}
- if (strstr(buf, basedir) != buf) {
+ if (strstr(buf, basedir) != buf
+#ifdef HOMEBREWDIR
+ && strstr(buf, HOMEBREWDIR) != buf
+#endif
+ ) {
if (warnings) say("",
"%s: outside base directory", buf);
continue;
@@ -818,6 +822,10 @@ filescan(const char *file)
start = buf;
else if (strstr(buf, basedir) == buf)
start = buf + strlen(basedir);
+#ifdef HOMEBREWDIR
+ else if (strstr(buf, HOMEBREWDIR) == buf)
+ start = buf;
+#endif
else {
exitcode = (int)MANDOCLEVEL_BADARG;
say("", "%s: outside base directory", buf);