aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandocdb.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-05-04 17:48:28 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-05-04 17:48:28 +0000
commit6cff4f9d35431af8274477e9e1cd8dbb193f159a (patch)
tree915d9a7213a5eb4bcdd275befff13cc2a5e27720 /mandocdb.c
parent094f88dec3c7fd9ede485ab47df6943bd7686330 (diff)
downloadmandoc-6cff4f9d35431af8274477e9e1cd8dbb193f159a.tar.gz
mandoc-6cff4f9d35431af8274477e9e1cd8dbb193f159a.tar.zst
mandoc-6cff4f9d35431af8274477e9e1cd8dbb193f159a.zip
Parser reorg:
Generate the first node on the roff level: .br Fix some column numbers in diagnostic messages while here.
Diffstat (limited to 'mandocdb.c')
-rw-r--r--mandocdb.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 10023d08..f7dfcab0 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.246 2017/04/24 23:06:18 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.247 2017/05/04 17:48:28 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -302,7 +302,6 @@ static const struct mdoc_handler __mdocs[MDOC_MAX - MDOC_Dd] = {
{ NULL, 0, 0 }, /* En */
{ NULL, TYPE_Dx, NODE_NOSRC }, /* Dx */
{ NULL, 0, 0 }, /* %Q */
- { NULL, 0, 0 }, /* br */
{ NULL, 0, 0 }, /* sp */
{ NULL, 0, 0 }, /* %U */
{ NULL, 0, 0 }, /* Ta */
@@ -1547,8 +1546,11 @@ parse_mdoc(struct mpage *mpage, const struct roff_meta *meta,
{
for (n = n->child; n != NULL; n = n->next) {
- if (n->tok == TOKEN_NONE || n->flags & mdocs[n->tok].taboo)
+ if (n->tok == TOKEN_NONE ||
+ n->tok < ROFF_MAX ||
+ n->flags & mdocs[n->tok].taboo)
continue;
+ assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX);
switch (n->type) {
case ROFFT_ELEM:
case ROFFT_BLOCK: