From 90ee934d1309a0871b08fdb50a27fffcb1c6019e Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 20 Sep 2011 13:13:23 +0000 Subject: When advancing the left margin, .RS also needs to reset the right margin to the default and check that the left does not outgrow the right one. Otherwise, the (rmargin >= offset) assertion fails in term_flushln(). Bug found and fix tested by kristaps@ with NetBSD slapo-retcode(5). --- man_term.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'man_term.c') diff --git a/man_term.c b/man_term.c index 65e95e9e..379a39ab 100644 --- a/man_term.c +++ b/man_term.c @@ -826,7 +826,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; -- cgit