aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roff.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-06-13 13:51:11 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-06-13 13:51:11 +0000
commit15d0494a307f70b4e1f9e676dd38e057228d319d (patch)
treefada06d98455ea27a3bc1cb0a4f8e73cca181b98 /roff.c
parent2e262df61fb29e0d6429e282a1bf5a4d5217477b (diff)
downloadmandoc-15d0494a307f70b4e1f9e676dd38e057228d319d.tar.gz
mandoc-15d0494a307f70b4e1f9e676dd38e057228d319d.tar.zst
mandoc-15d0494a307f70b4e1f9e676dd38e057228d319d.zip
Explicitly ignore .br, .ce, and .sp inside tbl(7) text blocks.
With the current code structure, they would appear at the wrong place in the syntax tree, so it is better to not insert them into the tree at all and issue an UNSUPP message instead.
Diffstat (limited to 'roff.c')
-rw-r--r--roff.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/roff.c b/roff.c
index 49c49078..34085d1a 100644
--- a/roff.c
+++ b/roff.c
@@ -1,4 +1,4 @@
-/* $Id: roff.c,v 1.307 2017/06/08 19:35:51 schwarze Exp $ */
+/* $Id: roff.c,v 1.308 2017/06/13 13:51:11 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -1548,10 +1548,11 @@ roff_parseln(struct roff *r, int ln, struct buf *buf, int *offs)
/* Tables ignore most macros. */
- if (r->tbl != NULL && (t == TOKEN_NONE || t == ROFF_TS)) {
+ if (r->tbl != NULL && (t == TOKEN_NONE || t == ROFF_TS ||
+ t == ROFF_br || t == ROFF_ce || t == ROFF_sp)) {
mandoc_msg(MANDOCERR_TBLMACRO, r->parse,
ln, pos, buf->buf + spos);
- if (t == ROFF_TS)
+ if (t != TOKEN_NONE)
return ROFF_IGN;
while (buf->buf[pos] != '\0' && buf->buf[pos] != ' ')
pos++;