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

source@mandoc.bsd.lv

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/mandoc-source

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 mandoc-source mandoc-source/ http://inbox.vuxu.org/mandoc-source \
		source@mandoc.bsd.lv
	public-inbox-index mandoc-source

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.mandoc.source


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git