From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id e7218ddc for ; Sat, 8 Jul 2017 08:43:46 -0500 (EST) Date: Sat, 8 Jul 2017 08:43:46 -0500 (EST) Message-Id: <3103268943771550820.enqueue@fantadrom.bsd.lv> X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: Correctly handle horizontal spans at the beginning of rows, X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Correctly handle horizontal spans at the beginning of rows, fixing an assertion failure found by jsg@ with afl(1). While here, also drop printing of whitespace in tbl_data() which makes no difference because column positioning code in term_tbl() already takes care of that. Modified Files: -------------- mandoc: tbl_term.c Revision Data ------------- Index: tbl_term.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/tbl_term.c,v retrieving revision 1.55 retrieving revision 1.56 diff -Ltbl_term.c -Ltbl_term.c -u -p -r1.55 -r1.56 --- tbl_term.c +++ tbl_term.c @@ -170,7 +170,8 @@ term_tbl(struct termp *tp, const struct if (dp == NULL) continue; spans = dp->spans; - dp = dp->next; + if (ic || sp->layout->first->pos != TBL_CELL_SPAN) + dp = dp->next; } /* Set up a column for a right vertical frame. */ @@ -204,7 +205,8 @@ term_tbl(struct termp *tp, const struct if (dp == NULL) continue; spans = dp->spans; - dp = dp->next; + if (cp->pos != TBL_CELL_SPAN) + dp = dp->next; } break; } @@ -304,7 +306,9 @@ term_tbl(struct termp *tp, const struct } if (dp != NULL) { spans = dp->spans; - dp = dp->next; + if (ic || sp->layout->first->pos + != TBL_CELL_SPAN) + dp = dp->next; } /* @@ -514,14 +518,11 @@ tbl_data(struct termp *tp, const struct break; } - if (dp == NULL) { - tbl_char(tp, ASCII_NBRSP, col->width); + if (dp == NULL) return; - } switch (dp->pos) { case TBL_DATA_NONE: - tbl_char(tp, ASCII_NBRSP, col->width); return; case TBL_DATA_HORIZ: case TBL_DATA_NHORIZ: @@ -546,7 +547,7 @@ tbl_data(struct termp *tp, const struct tbl_number(tp, opts, dp, col); break; case TBL_CELL_DOWN: - tbl_char(tp, ASCII_NBRSP, col->width); + case TBL_CELL_SPAN: break; default: abort(); -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv