summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2015-10-15 22:27:10 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2015-10-15 22:27:10 +0000
commit24cce8bf99cb46372633d63199daa6c0e9692e38 (patch)
tree031e90ecb022eecc32c57803d1bacb0ce21872b8 /usr.bin/mandoc
parent3ce02db96f22b0ee9e74a08d9621c1dde92150c5 (diff)
When blk_full() handles an .It line in .Bl -column and indirectly
calls phrase_ta() to handle a .Ta child macro, advance the body pointer accordingly, such that a subsequent tab character rewinds the right body block and doesn't fail an assertion. That happened when there was nothing between the .Ta and the tab character. Bug reported by tim@ some time ago.
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r--usr.bin/mandoc/mdoc_macro.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/mandoc/mdoc_macro.c b/usr.bin/mandoc/mdoc_macro.c
index fe74b5e574a..7f53a3a92c8 100644
--- a/usr.bin/mandoc/mdoc_macro.c
+++ b/usr.bin/mandoc/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_macro.c,v 1.159 2015/10/12 00:07:27 schwarze Exp $ */
+/* $OpenBSD: mdoc_macro.c,v 1.160 2015/10/15 22:27:09 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -1106,6 +1106,11 @@ blk_full(MACRO_PROT_ARGS)
mdoc->flags |= MDOC_PPHRASE;
parse_rest(mdoc, TOKEN_NONE, line, &la, buf);
mdoc->flags &= ~MDOC_PPHRASE;
+
+ /* There may have been `Ta' macros. */
+
+ while (body->next != NULL)
+ body = body->next;
continue;
}