diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2021-09-10 12:06:30 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2021-09-10 12:06:30 +0000 |
commit | 3fc6a29b9af9fb90050ff00c88744cb25b1a0dc6 (patch) | |
tree | 737d42945081ccbc48138b468cb048849d42b3b6 /usr.bin/mandoc/tbl_data.c | |
parent | 6f544971dcfca858a757dfe55d0d3d40f23e8f75 (diff) |
In a tbl(7) having the "nospaces" option, skip space characters
not only at the end of data cells, but also after "T}",
aligning the behaviour of the parser with GNU tbl(1).
Issue reported by <Oliver dot Corff at email dot de>.
Diffstat (limited to 'usr.bin/mandoc/tbl_data.c')
-rw-r--r-- | usr.bin/mandoc/tbl_data.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/mandoc/tbl_data.c b/usr.bin/mandoc/tbl_data.c index e98933e1323..315a1949c0f 100644 --- a/usr.bin/mandoc/tbl_data.c +++ b/usr.bin/mandoc/tbl_data.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tbl_data.c,v 1.44 2021/09/07 11:47:42 schwarze Exp $ */ +/* $OpenBSD: tbl_data.c,v 1.45 2021/09/10 12:06:29 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011,2015,2017-2019,2021 Ingo Schwarze <schwarze@openbsd.org> @@ -198,6 +198,9 @@ tbl_cdata(struct tbl_node *tbl, int ln, const char *p, int pos) if (p[pos] == 'T' && p[pos + 1] == '}') { pos += 2; + if (tbl->opts.opts & TBL_OPT_NOSPACE) + while (p[pos] == ' ') + pos++; if (p[pos] == tbl->opts.tab) { tbl->part = TBL_PART_DATA; pos++; |