=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mandocdb.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- src/usr.bin/mandoc/mandocdb.c 2011/11/27 23:27:16 1.13 +++ src/usr.bin/mandoc/mandocdb.c 2011/11/28 00:57:28 1.14 @@ -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 * Copyright (c) 2011 Ingo Schwarze @@ -27,6 +27,7 @@ #include #include #include +#include #include #include "man.h" @@ -374,10 +375,12 @@ 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 @@ of = of->first; + chdir(dirs.paths[i]); index_merge(of, mp, &dbuf, &buf, hash, db, fbuf, idx, ibuf, maxrec, recs, reccur); }