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.5/8.14.5) with ESMTP id q042TYDD029396 for ; Tue, 3 Jan 2012 21:29:35 -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 1RiGbc-00008d-Re; Wed, 04 Jan 2012 03:29:32 +0100 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.72) (envelope-from ) id 1RiGbc-0002Br-SF for tech@mdocml.bsd.lv; Wed, 04 Jan 2012 03:29:32 +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 1RiGbc-00064o-Qh for tech@mdocml.bsd.lv; Wed, 04 Jan 2012 03:29:32 +0100 Received: from schwarze by usta.de with local (Exim 4.72) (envelope-from ) id 1RiGbc-00038w-Gp for tech@mdocml.bsd.lv; Wed, 04 Jan 2012 03:29:32 +0100 Date: Wed, 4 Jan 2012 03:29:32 +0100 From: Ingo Schwarze To: tech@mdocml.bsd.lv Subject: Re: mdocml: `-diag' lists aren't parsed, unlike other list types. Message-ID: <20120104022932.GH2607@iris.usta.de> References: <201201021548.q02Fm65M026067@krisdoz.my.domain> 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: <201201021548.q02Fm65M026067@krisdoz.my.domain> User-Agent: Mutt/1.5.21 (2010-09-15) Hi Kristaps, kristaps@mdocml.bsd.lv wrote on Mon, Jan 02, 2012 at 10:48:06AM -0500: > `-diag' lists aren't parsed, unlike other list types. > This fixes a TODO entry raised by deraadt@. i hate to say so, but this fix is incomplete: It only fixes the first .It macro in each -diag list. To fix the subsequent ones as well, the check has to be moved after the creation of the .It block, such that we can look for the parent. While moving the check, we can drop the if-statement and make the comment more precise. OK? Ingo CVSROOT: /cvs Module name: src Changes by: schwarze@cvs.openbsd.org 2012/01/03 19:17:42 Modified files: usr.bin/mandoc : mdoc_macro.c regress/usr.bin/mandoc/mdoc/Bl: diag.in diag.out_ascii Log message: Heads of .It macros in -diag lists are not parsed, even though .It macros in general are parsed. Fixing a bug reported by deraadt@, based on an incomplete fix by kristaps@, and update the test suite to catch this issue. --- /co/mdocml/mdoc_macro.c Wed Jan 4 03:24:13 2012 +++ ./mdoc_macro.c Wed Jan 4 03:17:42 2012 @@ -994,16 +990,6 @@ enum margverr av; char *p; - /* - * Exception: `-diag' lists are not parsed, but lists in general - * are parsed. - */ - nparsed = 0; - if (MDOC_It == tok && NULL != m->last && - MDOC_Bl == m->last->tok && - LIST_diag == m->last->norm->Bl.type) - nparsed = 1; - nl = MDOC_NEWLINE & m->flags; /* Close out prior implicit scope. */ @@ -1046,6 +1032,14 @@ return(0); head = body = NULL; + + /* + * Exception: Heads of `It' macros in `-diag' lists are not + * parsed, even though `It' macros in general are parsed. + */ + nparsed = MDOC_It == tok && + MDOC_Bl == m->last->parent->tok && + LIST_diag == m->last->parent->norm->Bl.type; /* * The `Nd' macro has all arguments in its body: it's a hybrid -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv