source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: When looking for the last layout row used, we need to look at
@ 2021-05-15 17:19 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2021-05-15 17:19 UTC (permalink / raw)
  To: source

Log Message:
-----------
When looking for the last layout row used, we need to look at the layout
row used for the previous data line containing data, not at the previous
data line outright, which might be a horizontal ruler.  If it is, do not
restart from the first layout row but still proceed to the next data row,
which may have been just read from T&.

Bug originally reported by Oliver dot Corff at email dot de 
on groff at gnu dot org:
https://lists.gnu.org/archive/html/groff/2021-03/msg00003.html  
and forwarded to me by bentley@.

Patch OK'ed by bentley@ back in April.

Modified Files:
--------------
    mandoc:
        tbl_data.c

Revision Data
-------------
Index: tbl_data.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/tbl_data.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -Ltbl_data.c -Ltbl_data.c -u -p -r1.53 -r1.54
--- tbl_data.c
+++ tbl_data.c
@@ -244,10 +244,11 @@ tbl_data(struct tbl_node *tbl, int ln, c
 	struct tbl_cell	*cp;
 	struct tbl_span	*sp;
 
-	rp = (sp = tbl->last_span) == NULL ? tbl->first_row :
-	    sp->pos == TBL_SPAN_DATA && sp->layout->next != NULL ?
-	    sp->layout->next : sp->layout;
-
+	for (sp = tbl->last_span; sp != NULL; sp = sp->prev)
+		if (sp->pos == TBL_SPAN_DATA)
+			break;
+	rp = sp == NULL ? tbl->first_row :
+	    sp->layout->next == NULL ? sp->layout : sp->layout->next;
 	assert(rp != NULL);
 
 	if (p[1] == '\0') {
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-15 17:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-15 17:19 mandoc: When looking for the last layout row used, we need to look at schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).