diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2013-06-01 04:56:50 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2013-06-01 04:56:50 +0000 |
commit | 25b0103191a0ceaf99b445cec57298031421d819 (patch) | |
tree | 87418eb4cdd719d595e17853c998c2459a786a71 /tbl_data.c | |
parent | 1dd60fad1a59475e372291d0dd558394c86b1c5a (diff) | |
download | mandoc-25b0103191a0ceaf99b445cec57298031421d819.tar.gz |
If a table contained at least one complete line
and on its last line, the first T{ remained unclosed,
roff_parseln() never returned ROFF_TBL for that last line,
so {man,mdoc}_addspan() never got called for that last line,
so we ended up with a table
where no line associated with a node had TBL_SPAN_LAST set,
so tbl_term() never free()'d the cols in struct roffcol,
so tblcalc() crashed on the NULL == tbl->cols assertion
when starting the *next* table in the same file.
Fix this by returning ROFF_TBL as soon as we open a data cell,
not only when finishing it - as explained above, it may never
get properly closed but instead be interrupted by .TE.
Problem reported by bentley@ in latex2man.1.
I love it when bugs take half a day to debug but
the fix turns out to be flipping one single bit in the source code.
Diffstat (limited to 'tbl_data.c')
-rw-r--r-- | tbl_data.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -102,7 +102,7 @@ data(struct tbl_node *tbl, struct tbl_span *dp, if (*pos - sv == 2 && 'T' == p[sv] && '{' == p[sv + 1]) { tbl->part = TBL_PART_CDATA; - return(0); + return(1); } assert(*pos - sv >= 0); |