aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit481fa37c9d12175d129ac739a8959a5da5a6d478 (patch)
tree2ece135b24bf7a8fd8d07caf5d424ff5b8498a67 /mandocdb.c
parent2c8780108e37e85285813e3f999444c3e861a456 (diff)
downloadmandoc-481fa37c9d12175d129ac739a8959a5da5a6d478.tar.gz
mandoc-481fa37c9d12175d129ac739a8959a5da5a6d478.tar.zst
mandoc-481fa37c9d12175d129ac739a8959a5da5a6d478.zip
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.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/mandocdb.c b/mandocdb.c
index b403ceb9..6ae390be 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.183 2015/01/15 04:26:40 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.184 2015/01/21 22:41:49 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -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);