summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2015-02-12 13:00:28 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2015-02-12 13:00:28 +0000
commit47f62b8db5df6c72c4d691f157a6053c41177512 (patch)
tree1acc700ed73cb42d0a2f113d2bf23847afb6c120 /usr.bin
parent47e09eae357b2e21b53af1df064746c9bc48e18a (diff)
Do not confuse .Bl -column lists that just broken another block
with newly opened .Bl -column lists; fixing an assertion failure jsg@ found with afl: test case #481, Bl It Bl -column It Bd El text text El
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mandoc/mdoc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c
index af0f1cc474a..24b625ef264 100644
--- a/usr.bin/mandoc/mdoc.c
+++ b/usr.bin/mandoc/mdoc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc.c,v 1.126 2015/02/12 12:20:47 schwarze Exp $ */
+/* $OpenBSD: mdoc.c,v 1.127 2015/02/12 13:00:27 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -599,8 +599,8 @@ mdoc_ptext(struct mdoc *mdoc, int line, char *buf, int offs)
* process within its context in the normal way).
*/
- if (MDOC_Bl == n->tok && MDOC_BODY == n->type &&
- LIST_column == n->norm->Bl.type) {
+ if (n->tok == MDOC_Bl && n->type == MDOC_BODY &&
+ n->end == ENDBODY_NOT && n->norm->Bl.type == LIST_column) {
/* `Bl' is open without any children. */
mdoc->flags |= MDOC_FREECOL;
mdoc_macro(mdoc, MDOC_It, line, offs, &offs, buf);
@@ -776,8 +776,8 @@ mdoc_pmacro(struct mdoc *mdoc, int ln, char *buf, int offs)
* context around the parsed macro.
*/
- if (MDOC_Bl == n->tok && MDOC_BODY == n->type &&
- LIST_column == n->norm->Bl.type) {
+ if (n->tok == MDOC_Bl && n->type == MDOC_BODY &&
+ n->end == ENDBODY_NOT && n->norm->Bl.type == LIST_column) {
mdoc->flags |= MDOC_FREECOL;
mdoc_macro(mdoc, MDOC_It, ln, sv, &sv, buf);
return(1);