summaryrefslogtreecommitdiffstats
path: root/tbl_data.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2021-09-10 12:07:21 +0000
committerIngo Schwarze <schwarze@openbsd.org>2021-09-10 12:07:21 +0000
commit0f0b8f0b360106396aea586cbe1e932cebaa15f1 (patch)
tree839a24c6ca145ee1be12a3e0a2ec8c558a8fced6 /tbl_data.c
parent9c3d174e4a3afaf42374512b60ecaa54c98b3415 (diff)
downloadmandoc-0f0b8f0b360106396aea586cbe1e932cebaa15f1.tar.gz
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 'tbl_data.c')
-rw-r--r--tbl_data.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tbl_data.c b/tbl_data.c
index 046afc57..43d6ef5d 100644
--- a/tbl_data.c
+++ b/tbl_data.c
@@ -200,6 +200,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++;