=================================================================== RCS file: /cvs/mandoc/mandocdb.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -p -r1.16 -r1.17 --- mandoc/mandocdb.c 2011/11/27 23:27:31 1.16 +++ mandoc/mandocdb.c 2011/11/29 00:34:50 1.17 @@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.16 2011/11/27 23:27:31 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.17 2011/11/29 00:34:50 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * Copyright (c) 2011 Ingo Schwarze @@ -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); }