tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
* put back the chdir(2) in mandocdb(8)
@ 2011-11-28  1:09 Ingo Schwarze
  2011-11-28  8:40 ` Kristaps Dzonsons
  0 siblings, 1 reply; 4+ messages in thread
From: Ingo Schwarze @ 2011-11-28  1:09 UTC (permalink / raw)
  To: tech

OK to merge to bsd.lv?

----- Forwarded message from Ingo Schwarze <schwarze@cvs.openbsd.org> -----

From: Ingo Schwarze <schwarze@cvs.openbsd.org>
Date: Sun, 27 Nov 2011 17:57:28 -0700 (MST)
To: source-changes@cvs.openbsd.org
Subject: CVS: cvs.openbsd.org: src

CVSROOT:	/cvs
Module name:	src
Changes by:	schwarze@cvs.openbsd.org	2011/11/27 17:57:28

Modified files:
	usr.bin/mandoc : mandocdb.c 

Log message:
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.

----- End forwarded message -----

Index: mandocdb.c
===================================================================
RCS file: /cvs/src/usr.bin/mandoc/mandocdb.c,v
retrieving revision 1.13
diff -u -p -r1.13 mandocdb.c
--- mandocdb.c	27 Nov 2011 23:27:16 -0000	1.13
+++ mandocdb.c	28 Nov 2011 00:51:51 -0000
@@ -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);
 	}
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-28 21:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-28  1:09 put back the chdir(2) in mandocdb(8) Ingo Schwarze
2011-11-28  8:40 ` Kristaps Dzonsons
2011-11-28 10:06   ` Ingo Schwarze
2011-11-28 21:10     ` Kristaps Dzonsons

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).