tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Kristaps Dzonsons <kristaps@bsd.lv>
To: tech@mdocml.bsd.lv
Cc: Ingo Schwarze <schwarze@usta.de>
Subject: Re: sync results
Date: Tue, 05 Jul 2011 16:06:44 +0200	[thread overview]
Message-ID: <4E131A74.3050900@bsd.lv> (raw)
In-Reply-To: <4E1306FA.3070801@bsd.lv>

[-- Attachment #1: Type: text/plain, Size: 826 bytes --]

>> nsd-xfer(8) contains this code:
>>
>> .SH "OPTIONS"
>> .LP
>> .TP
>> .B \-4
>> Only send to IPv4 addresses.
>>
>> In groff and old mandoc, there is no blank line after OPTIONS,
>> now there is one.
>
> Ouch, this is indeed a bug: the syntax tree appears to be messed up by
> the removal of the `LP'. I'll look into it...

Ingo,

Please check if the enclosed patch fixes this problem without fallout. 
Basically, the "next node append type" for -man was automatically being 
set to NEXT, clobbering the value set during node deletion in the 
post-validator.  This was causing the `LP' to be removed and the next 
node, the `TP', being assigned under the block of `SH'.  Ew.  I 
eye-balled it over a selection of -man and ran it over my regular tests 
for failure.  This is quite an old bug, it turns out.

Thanks,

Kristaps

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1043 bytes --]

Index: man_macro.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_macro.c,v
retrieving revision 1.63
diff -u -r1.63 man_macro.c
--- man_macro.c	18 Jun 2011 17:36:52 -0000	1.63
+++ man_macro.c	5 Jul 2011 14:01:28 -0000
@@ -120,6 +120,9 @@
 
 	assert(to);
 
+	assert(MAN_ROOT != m->last->type);
+	m->next = MAN_NEXT_SIBLING;
+
 	/* LINTED */
 	while (m->last != to) {
 		/*
@@ -140,9 +143,6 @@
 	if ( ! man_valid_post(m))
 		return(0);
 
-	m->next = MAN_ROOT == m->last->type ? 
-		MAN_NEXT_CHILD : MAN_NEXT_SIBLING;
-
 	return(1);
 }
 
@@ -428,6 +428,9 @@
 		assert( ! (MAN_SCOPED & man_macros[tok].flags));
 		m->flags |= MAN_ILINE;
 	}
+
+	assert(MAN_ROOT != m->last->type);
+	m->next = MAN_NEXT_SIBLING;
 	
 	/*
 	 * Rewind our element scope.  Note that when TH is pruned, we'll
@@ -452,9 +455,6 @@
 
 	if (m->last->type != MAN_ROOT && ! man_valid_post(m))
 		return(0);
-
-	m->next = MAN_ROOT == m->last->type ?
-		MAN_NEXT_CHILD : MAN_NEXT_SIBLING;
 
 	return(1);
 }

  reply	other threads:[~2011-07-05 14:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-04 22:45 Ingo Schwarze
2011-07-05 12:43 ` Kristaps Dzonsons
2011-07-05 14:06   ` Kristaps Dzonsons [this message]
2011-07-07  4:13     ` Ingo Schwarze
2011-07-06  6:03   ` Ingo Schwarze
2011-07-07 10:27     ` Kristaps Dzonsons
2011-07-07 21:11       ` Ingo Schwarze

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=4E131A74.3050900@bsd.lv \
    --to=kristaps@bsd.lv \
    --cc=schwarze@usta.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).