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 pAGJrSw7025137 for ; Wed, 16 Nov 2011 14:53:29 -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 1RQlXz-0004Fw-IF; Wed, 16 Nov 2011 20:53:27 +0100 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.72) (envelope-from ) id 1RQlXz-0007jp-IE for tech@mdocml.bsd.lv; Wed, 16 Nov 2011 20:53:27 +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 1RQlXz-0005qB-H7 for tech@mdocml.bsd.lv; Wed, 16 Nov 2011 20:53:27 +0100 Received: from schwarze by usta.de with local (Exim 4.72) (envelope-from ) id 1RQlXz-0006ov-5U for tech@mdocml.bsd.lv; Wed, 16 Nov 2011 20:53:27 +0100 Date: Wed, 16 Nov 2011 20:53:26 +0100 From: Ingo Schwarze To: tech@mdocml.bsd.lv Subject: correct mdoc_node.sec in .Sh HEAD Message-ID: <20111116195326.GS31182@iris.usta.de> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) OK to commit to bsd.lv as well? Ingo ----- Forwarded message from Ingo Schwarze ----- From: Ingo Schwarze Date: Wed, 16 Nov 2011 12:47:58 -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/16 12:47:58 Modified files: usr.bin/mandoc : mdoc_validate.c Log message: When processing .Sh HEAD, as soon as we know which section this is, fix up the section attributes of the HEAD, it's parent BLOCK, and all its (text) children. This is required because the section attributes get set when each node is allocated, i.e. before processing the content of the node itself. Thus, the listed nodes got the section attribute of the preceding section. No need to fix up the BODY, all is fine there already. Found while implementing TYPE_Sh for mandocdb(8). ----- End forwarded message ----- Index: mdoc_validate.c =================================================================== RCS file: /cvs/src/usr.bin/mandoc/mdoc_validate.c,v retrieving revision 1.96 diff -u -p -r1.96 mdoc_validate.c --- mdoc_validate.c 16 Oct 2011 12:18:32 -0000 1.96 +++ mdoc_validate.c 16 Nov 2011 19:22:41 -0000 @@ -1814,6 +1814,7 @@ static int post_sh_head(POST_ARGS) { char buf[BUFSIZ]; + struct mdoc_node *n; enum mdoc_sec sec; int c; @@ -1847,6 +1848,10 @@ post_sh_head(POST_ARGS) /* Mark our last section. */ mdoc->lastsec = sec; + mdoc->last->parent->sec = sec; + mdoc->last->sec = sec; + for (n = mdoc->last->child; n; n = n->next) + n->sec = sec; /* We don't care about custom sections after this. */ -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv