tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: Joerg Sonnenberger <joerg@britannica.bec.de>
Cc: tech@mdocml.bsd.lv
Subject: Re: Fix for BLINE removal
Date: Wed, 16 Nov 2011 18:24:07 +0100	[thread overview]
Message-ID: <20111116172407.GP31182@iris.usta.de> (raw)
In-Reply-To: <20111116141239.GA15654@britannica.bec.de>

Hi Joerg,

Joerg Sonnenberger wrote on Wed, Nov 16, 2011 at 03:12:39PM +0100:

> 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?

I can confirm both the problem and the fix, i see no regressions,
and have just committed your patch to OpenBSD.  If you want to commit
to bsd.lv, that's OK schwarze@.

Thanks!
  Ingo


> 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;
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

      reply	other threads:[~2011-11-16 17:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-16 14:12 Joerg Sonnenberger
2011-11-16 17:24 ` Ingo Schwarze [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111116172407.GP31182@iris.usta.de \
    --to=schwarze@usta.de \
    --cc=joerg@britannica.bec.de \
    --cc=tech@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).