From 254ae39f2f6d2771a85ade494541410226ac8c03 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 29 Nov 2011 00:34:50 +0000 Subject: chdir(2) to the right man page tree before parsing manuals; ok kristaps@ --- mandocdb.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/mandocdb.c b/mandocdb.c index fed68258..4959350e 100644 --- a/mandocdb.c +++ b/mandocdb.c @@ -31,6 +31,7 @@ #include #include #include +#include #ifdef __linux__ # include @@ -383,10 +384,18 @@ main(int argc, char *argv[]) index_prune(of, db, fbuf, idx, ibuf, &maxrec, &recs, &recsz); - if (OP_UPDATE == op) + /* + * Go to the root of the respective manual tree + * such that .so links work. In case of failure, + * just prod on, even though .so links won't work. + */ + + if (OP_UPDATE == op) { + chdir(dir); index_merge(of, mp, &dbuf, &buf, hash, db, fbuf, idx, ibuf, maxrec, recs, reccur); + } goto out; } @@ -455,6 +464,13 @@ main(int argc, char *argv[]) of = of->first; + /* + * Go to the root of the respective manual tree + * such that .so links work. In case of failure, + * just prod on, even though .so links won't work. + */ + + chdir(dirs.paths[i]); index_merge(of, mp, &dbuf, &buf, hash, db, fbuf, idx, ibuf, maxrec, recs, reccur); } -- cgit