From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from scc-mailout.scc.kit.edu (scc-mailout.scc.kit.edu [129.13.185.202]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id pASA6rIN026368 for ; Mon, 28 Nov 2011 05:06:53 -0500 (EST) Received: from hekate.usta.de (asta-nat.asta.uni-karlsruhe.de [172.22.63.82]) by scc-mailout-02.scc.kit.edu with esmtp (Exim 4.72 #1) id 1RUy6v-0001uO-1B; Mon, 28 Nov 2011 11:06:53 +0100 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.72) (envelope-from ) id 1RUy6v-0000pd-3N for tech@mdocml.bsd.lv; Mon, 28 Nov 2011 11:06:53 +0100 Received: from iris.usta.de ([172.24.96.5] helo=usta.de) by donnerwolke.usta.de with esmtp (Exim 4.72) (envelope-from ) id 1RUy6v-0007nR-2D for tech@mdocml.bsd.lv; Mon, 28 Nov 2011 11:06:53 +0100 Received: from schwarze by usta.de with local (Exim 4.72) (envelope-from ) id 1RUy6v-00027z-0N for tech@mdocml.bsd.lv; Mon, 28 Nov 2011 11:06:53 +0100 Date: Mon, 28 Nov 2011 11:06:52 +0100 From: Ingo Schwarze To: tech@mdocml.bsd.lv Subject: Re: put back the chdir(2) in mandocdb(8) Message-ID: <20111128100652.GB17736@iris.usta.de> References: <20111128010917.GC15140@iris.usta.de> <4ED348F7.9040805@bsd.lv> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ED348F7.9040805@bsd.lv> User-Agent: Mutt/1.5.21 (2010-09-15) Hi Kristaps, Kristaps Dzonsons wrote on Mon, Nov 28, 2011 at 09:40:23AM +0100: > On 28/11/2011 02:09, Ingo Schwarze wrote: >> 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. > Yes, please do. > However, can you add a little explanation for the chdir() Yes. > and check its return value? No. OK? Ingo Index: mandocdb.c =================================================================== RCS file: /cvs/src/usr.bin/mandoc/mandocdb.c,v retrieving revision 1.14 diff -u -p -r1.14 mandocdb.c --- mandocdb.c 28 Nov 2011 00:57:28 -0000 1.14 +++ mandocdb.c 28 Nov 2011 10:04:58 -0000 @@ -375,6 +375,12 @@ mandocdb(int argc, char *argv[]) index_prune(of, db, fbuf, idx, ibuf, &maxrec, &recs, &recsz); + /* + * 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, @@ -448,6 +454,12 @@ mandocdb(int argc, char *argv[]) continue; 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, -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv