tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: tech@mdocml.bsd.lv
Subject: Re: TERMP_NOLPAD r.i.p.
Date: Tue, 20 Sep 2011 14:14:26 +0200	[thread overview]
Message-ID: <20110920121426.GB13269@iris.usta.de> (raw)
In-Reply-To: <4E78751D.6040700@bsd.lv>

Hi Kristaps,

Kristaps Dzonsons wrote on Tue, Sep 20, 2011 at 01:12:29PM +0200:

> This last checkin raised an assertion failure when run over NetBSD's
> manuals.  One can reproduce the failure as follows (cut from
> slapo-retcode.5):
> 
> .TH SLAPO-RETCODE 5 "2010/06/30" "OpenLDAP 2.4.23"
> .SH NAME
> slapo\-retcode \- return code overlay to slapd
> .SH DESCRIPTION
> This directive defines the parent DN where dynamically generated
> entries reside.
> If not defined, the suffix of the database is used.
> .HP
> .hy 0
> .B retcode\-item <RDN> <errCode> [op=<oplist>] [text=<message>]
> .B [ref=<referral>] [sleeptime=<sec>] [matched=<DN>]
> .B [unsolicited=<OID>[:<data>]] [flags=[{pre|post}\-]disconnect[,...]]
> .RS
> A dynamically generated entry, located below \fBretcode\-parent\fP.

Looks like that is an unrelated bug in pre_RS, merely uncovered
by the changes.  When changing the output offset, .RS neglects
to reset the right margin to the default, and it also neglects
to check whether the offset fits into the margin.

The following fixes the (ugly!) test page, and i see no
regressions.

OK?
  Ingo


Index: man_term.c
===================================================================
RCS file: /cvs/src/usr.bin/mandoc/man_term.c,v
retrieving revision 1.73
diff -u -p -r1.73 man_term.c
--- man_term.c	20 Sep 2011 09:02:18 -0000	1.73
+++ man_term.c	20 Sep 2011 12:04:15 -0000
@@ -822,7 +822,8 @@ pre_RS(DECL_ARGS)
 			sz = (size_t)ival;
 
 	mt->offset += sz;
-	p->offset = mt->offset;
+	p->rmargin = p->maxrmargin;
+	p->offset = mt->offset < p->rmargin ? mt->offset : p->rmargin;
 
 	if (++mt->lmarginsz < MAXMARGINS)
 		mt->lmargincur = mt->lmarginsz;
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

  parent reply	other threads:[~2011-09-20 12:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20110918161317.GE29692@iris.usta.de>
     [not found] ` <4E765AFE.9070302@bsd.lv>
2011-09-19 21:39   ` Ingo Schwarze
2011-09-19 21:58     ` Kristaps Dzonsons
2011-09-20 11:12       ` Kristaps Dzonsons
2011-09-20 11:14         ` Kristaps Dzonsons
2011-09-20 12:14         ` Ingo Schwarze [this message]
2011-09-20 12:26           ` Kristaps Dzonsons
2011-09-20 13:34             ` Ingo Schwarze
2011-09-20 14:05               ` 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=20110920121426.GB13269@iris.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).