diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2021-09-10 12:07:21 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2021-09-10 12:07:21 +0000 |
commit | 2b21b1bfceddeb3d2792365b8b1e3fdafd99006d (patch) | |
tree | b3f6f9cf9f006029751a55097d7e6cf8e0d2fc8a | |
parent | aab52fb63330ba1f89b1550f1176f21b2a445533 (diff) | |
download | mandoc-2b21b1bfceddeb3d2792365b8b1e3fdafd99006d.tar.gz mandoc-2b21b1bfceddeb3d2792365b8b1e3fdafd99006d.tar.zst mandoc-2b21b1bfceddeb3d2792365b8b1e3fdafd99006d.zip |
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>.
-rw-r--r-- | tbl_data.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: tbl_data.c,v 1.57 2021/09/07 11:48:19 schwarze Exp $ */ +/* $Id: tbl_data.c,v 1.58 2021/09/10 12:07:21 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011,2015,2017-2019,2021 Ingo Schwarze <schwarze@openbsd.org> @@ -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++; |