tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: tech@mdocml.bsd.lv
Subject: Re: tbl(7) and preceding line boundaries
Date: Fri, 6 Mar 2015 11:49:09 +0100	[thread overview]
Message-ID: <20150306104909.GA12226@athene.usta.de> (raw)
In-Reply-To: <54F976CF.6020604@bsd.lv>

Hi Kristaps,

Kristaps Dzonsons wrote on Fri, Mar 06, 2015 at 10:43:43AM +0100:

> I'm able to fool mandoc(1) into arbitrarily stretching its page boundary
> by the enclosed graph.  In short, it seems that tbl(7) code directly
> following free-form text causes a flush of the text after the right
> margin is relieved.

Looking at the history of tbl_term.c, that seems to be broken since
basically forever, at least since 2011.

> Ideas?

Do you agree with the following simple fix?

It doesn't seem important enough to make the OpenBSD 5.7 release,
though.  If you agree, i would commit to bsd.lv now and to OpenBSD
after unlock.

Yours,
  Ingo


Index: tbl_term.c
===================================================================
RCS file: /cvs/src/usr.bin/mandoc/tbl_term.c,v
retrieving revision 1.26
diff -u -p -r1.26 tbl_term.c
--- tbl_term.c	31 Jan 2015 00:11:52 -0000	1.26
+++ tbl_term.c	6 Mar 2015 10:46:19 -0000
@@ -64,6 +64,9 @@ term_tbl(struct termp *tp, const struct 
 	size_t			 rmargin, maxrmargin, tsz;
 	int			 ic, horiz, spans, vert;
 
+	if (tp->tbl.cols == NULL)
+		term_flushln(tp);
+
 	rmargin = tp->rmargin;
 	maxrmargin = tp->maxrmargin;
 
@@ -80,8 +83,6 @@ term_tbl(struct termp *tp, const struct 
 	 */
 
 	if (tp->tbl.cols == NULL) {
-		term_flushln(tp);
-
 		tp->tbl.len = term_tbl_len;
 		tp->tbl.slen = term_tbl_strlen;
 		tp->tbl.arg = tp;
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

  reply	other threads:[~2015-03-06 10:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-06  9:43 Kristaps Dzonsons
2015-03-06 10:49 ` Ingo Schwarze [this message]
2015-03-06 10:55   ` Kristaps Dzonsons
2015-03-06 22:24     ` Ingo Schwarze
2015-03-06 11:04   ` Kristaps Dzonsons
2015-03-06 13:43     ` Ingo Schwarze
2015-03-06 15:02       ` Kristaps Dzonsons

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150306104909.GA12226@athene.usta.de \
    --to=schwarze@usta.de \
    --cc=tech@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).