From 1884bb6738b198c3d176991d91656eeb9242fb82 Mon Sep 17 00:00:00 2001
From: Ingo Schwarze <schwarze@cvs.openbsd.org>
Date: Fri, 1 May 2015 16:01:54 +0000
Subject: Setting the "last" member of struct roff_node was done at an
 extremely weird place.  Move it to the obviously correct place. Surprisingly,
 this didn't cause any misformatting in the test suite or in any base system
 manuals, but i cannot believe the code was really correct for all conceivable
 input, and it would be very hard to verify.  At the very least, it cannot
 have worked for man(7).

---
 usr.bin/mandoc/roff.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'usr.bin/mandoc/roff.c')

diff --git a/usr.bin/mandoc/roff.c b/usr.bin/mandoc/roff.c
index d82eb79552b..f99246a7686 100644
--- a/usr.bin/mandoc/roff.c
+++ b/usr.bin/mandoc/roff.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: roff.c,v 1.141 2015/04/23 16:17:04 schwarze Exp $ */
+/*	$OpenBSD: roff.c,v 1.142 2015/05/01 16:01:53 schwarze Exp $ */
 /*
  * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -1020,6 +1020,7 @@ roff_node_append(struct roff_man *man, struct roff_node *n)
 		/* NOTREACHED */
 	}
 	n->parent->nchild++;
+	n->parent->last = n;
 
 	/*
 	 * Copy over the normalised-data pointer of our parent.  Not
-- 
cgit v1.2.3