- have_data = 0;
- cp = rp->first;
- for (dp = sp->first; dp != NULL; dp = dp->next) {
- if (dp->pos == TBL_DATA_DATA && *dp->string != '\0') {
- if (cp == NULL ||
- (cp->pos != TBL_CELL_HORIZ &&
- cp->pos != TBL_CELL_DHORIZ))
- return;
- have_data = 1;
- }
- spans = dp->spans;
- while (spans-- >= 0) {
- if (cp != NULL)
- cp = cp->next;
- }
+ while (rp->next != NULL) {
+ if (rp->last->col + 1 < tbl->opts.cols)
+ break;
+ for (cp = rp->first; cp != NULL; cp = cp->next)
+ if (cp->pos != TBL_CELL_HORIZ &&
+ cp->pos != TBL_CELL_DHORIZ)
+ break;
+ if (cp != NULL)
+ break;
+ sp = newspan(tbl, ln, rp);
+ sp->pos = TBL_SPAN_DATA;
+ rp = rp->next;