-# $OpenBSD: Makefile,v 1.8 2014/08/11 04:18:18 schwarze Exp $
+# $OpenBSD: Makefile,v 1.9 2014/08/17 18:42:07 schwarze Exp $
-REGRESS_TARGETS = empty font emptyNAME emptyNAMEuse badNAME badNAMEuse long
+REGRESS_TARGETS = badNAME badNAMEuse break empty emptyNAME emptyNAMEuse
+REGRESS_TARGETS += font long
-LINT_TARGETS = badNAME badNAMEuse
+LINT_TARGETS = badNAME badNAMEuse break
-SKIP_GROFF = emptyNAMEuse badNAMEuse
+# groff-1.22.2/mandoc difference:
+# When the first Nm does not have an argument but a later one has,
+# mandoc retroactively uses the later name for the earlier instances
+# of Nm, too, while groff does not.
+
+SKIP_GROFF = badNAMEuse emptyNAMEuse
+
+# groff-1.22.2 defect:
+# When a SYNOPSIS Nm block head breaks a sub block, all the
+# remaining content in the document gets lost.
+
+SKIP_GROFF += break
.include <bsd.regress.mk>
--- /dev/null
+NM-BREAK(1) OpenBSD Reference Manual NM-BREAK(1)
+
+N\bNA\bAM\bME\bE
+ N\bNm\bm-\b-b\bbr\bre\bea\bak\bk - name block head breaking another block
+
+S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
+ b\bbe\bef\bfo\bor\bre\be [\b[w\bwi\bit\bth\bhi\bin\bn]\b]
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+ initial text N\bNm\bm-\b-b\bbr\bre\bea\bak\bk final text
+
+OpenBSD August 17, 2014 OpenBSD
-/* $Id: mdoc_term.c,v 1.177 2014/08/08 16:17:09 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.178 2014/08/17 18:42:07 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
* the "overstep" effect in term_flushln() and treat
* this as a `-ohang' list instead.
*/
- if (n->next->child &&
+ if (NULL != n->next &&
+ NULL != n->next->child &&
(MDOC_Bl == n->next->child->tok ||
MDOC_Bd == n->next->child->tok))
break;
* don't want to recalculate rmargin and offsets when
* using `Bd' or `Bl' within `-hang' overstep lists.
*/
- if (MDOC_HEAD == n->type && n->next->child &&
+ if (MDOC_HEAD == n->type &&
+ NULL != n->next &&
+ NULL != n->next->child &&
(MDOC_Bl == n->next->child->tok ||
MDOC_Bd == n->next->child->tok))
break;
if (MDOC_HEAD == n->type)
synopsis_pre(p, n->parent);
- if (MDOC_HEAD == n->type && n->next->child) {
+ if (MDOC_HEAD == n->type &&
+ NULL != n->next && NULL != n->next->child) {
p->flags |= TERMP_NOSPACE | TERMP_NOBREAK | TERMP_BRIND;
p->trailspace = 1;
p->rmargin = p->offset + term_len(p, 1);
if (MDOC_BLOCK == n->type) {
p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP);
- } else if (MDOC_HEAD == n->type && n->next->child) {
+ } else if (MDOC_HEAD == n->type &&
+ NULL != n->next && NULL != n->next->child) {
term_flushln(p);
p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG);
p->trailspace = 0;