From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mo-p00-ob.rzone.de (mo-p00-ob.rzone.de [81.169.146.162]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id pAGECrPE010449 for ; Wed, 16 Nov 2011 09:12:54 -0500 (EST) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/auYssS93lrJDFR6/Ng== X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (ip-2-202-131-36.web.vodafone.de [2.202.131.36]) by smtp.strato.de (klopstock mo32) (RZmta 26.10 AUTH) with (DHE-RSA-AES128-SHA encrypted) ESMTPA id V048dcnAGBotkq for ; Wed, 16 Nov 2011 15:12:40 +0100 (MET) Received: by britannica.bec.de (sSMTP sendmail emulation); Wed, 16 Nov 2011 15:12:39 +0100 Date: Wed, 16 Nov 2011 15:12:39 +0100 From: Joerg Sonnenberger To: tech@mdocml.bsd.lv Subject: Fix for BLINE removal Message-ID: <20111116141239.GA15654@britannica.bec.de> Mail-Followup-To: tech@mdocml.bsd.lv X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="W/nzBZO5zC0uMSeA" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi all, the attached patch fixes the BLINE removal logic in man(7) for cases like .TP 8 .SH foo This is one of the most popular issues with man pages in pkgsrc right now. Comments? Joerg --W/nzBZO5zC0uMSeA Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="man.c.diff" Index: man.c =================================================================== RCS file: /home/joerg/cvsroot/mdocml/man.c,v retrieving revision 1.113 diff -u -p -r1.113 man.c --- man.c 7 Nov 2011 01:24:40 -0000 1.113 +++ man.c 16 Nov 2011 14:11:00 -0000 @@ -556,10 +556,15 @@ man_pmacro(struct man *m, int ln, char * if ((m->flags & MAN_BLINE) && (MAN_BSCOPE & man_macros[tok].flags)) { n = m->last; - assert(MAN_TEXT != n->type); - /* Remove element that didn't end BLINE, if any. */ + /* Might be a text node like 8 in + * .TP 8 + * .SH foo + */ + if (MAN_TEXT == n->type) + n = n->parent; + /* Remove element that didn't end BLINE, if any. */ if ( ! (MAN_BSCOPE & man_macros[n->tok].flags)) n = n->parent; --W/nzBZO5zC0uMSeA-- -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv