summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2011-11-28 00:57:28 +0000
committerschwarze <schwarze@openbsd.org>2011-11-28 00:57:28 +0000
commited88dd7e34c37aa20d57787e9e4f3bc0c6e3f3a0 (patch)
treed04d3d4f2aa497d8925cec2a9a8f21adad939adf
parentImplement whatis(1) as a special apropos(1) mode as a part of (diff)
downloadwireguard-openbsd-ed88dd7e34c37aa20d57787e9e4f3bc0c6e3f3a0.tar.xz
wireguard-openbsd-ed88dd7e34c37aa20d57787e9e4f3bc0c6e3f3a0.zip
Put back the chdir(2) to the right man page tree before parsing manuals;
this got lost during the bsd.lv sync in rev. 1.10; oops. This is required for processing .so links: otherwise, several files in Xenocara fail to parse and cause ugly complaints instead.
-rw-r--r--usr.bin/mandoc/mandocdb.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/mandoc/mandocdb.c b/usr.bin/mandoc/mandocdb.c
index 2a6393d2df3..472a4afcbfb 100644
--- a/usr.bin/mandoc/mandocdb.c
+++ b/usr.bin/mandoc/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.13 2011/11/27 23:27:16 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.14 2011/11/28 00:57:28 schwarze Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -27,6 +27,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include <db.h>
#include "man.h"
@@ -374,10 +375,12 @@ mandocdb(int argc, char *argv[])
index_prune(of, db, fbuf, idx, ibuf,
&maxrec, &recs, &recsz);
- if (OP_UPDATE == op)
+ if (OP_UPDATE == op) {
+ chdir(dir);
index_merge(of, mp, &dbuf, &buf, hash,
db, fbuf, idx, ibuf,
maxrec, recs, reccur);
+ }
goto out;
}
@@ -446,6 +449,7 @@ mandocdb(int argc, char *argv[])
of = of->first;
+ chdir(dirs.paths[i]);
index_merge(of, mp, &dbuf, &buf, hash, db, fbuf,
idx, ibuf, maxrec, recs, reccur);
}