From: schwarze Date: Tue, 13 Jun 2017 13:50:17 +0000 (+0000) Subject: Explicitly ignore .br, .ce, and .sp inside tbl(7) text blocks. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=5bd13649d070add579d18557f714a58798e7b0a3;p=openbsd 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. --- 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 * Copyright (c) 2010-2015, 2017 Ingo Schwarze @@ -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++;