summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2017-06-13 13:50:17 +0000
committerschwarze <schwarze@openbsd.org>2017-06-13 13:50:17 +0000
commit5bd13649d070add579d18557f714a58798e7b0a3 (patch)
treeec99e237a6369e1e60df41d3ca00b976a590b471
parentTweak order of operands to check constant `cache_valias_mask' first. (diff)
downloadwireguard-openbsd-5bd13649d070add579d18557f714a58798e7b0a3.tar.xz
wireguard-openbsd-5bd13649d070add579d18557f714a58798e7b0a3.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.
-rw-r--r--usr.bin/mandoc/roff.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/mandoc/roff.c b/usr.bin/mandoc/roff.c
index dfb19918f2c..8a0396511be 100644
--- a/usr.bin/mandoc/roff.c
+++ b/usr.bin/mandoc/roff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: roff.c,v 1.179 2017/06/08 19:35:34 schwarze Exp $ */
+/* $OpenBSD: roff.c,v 1.180 2017/06/13 13:50:17 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -1546,10 +1546,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++;