diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2011-09-20 13:13:23 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2011-09-20 13:13:23 +0000 |
commit | 90ee934d1309a0871b08fdb50a27fffcb1c6019e (patch) | |
tree | 82b267dc2bd85fa3cb4204301ff5dad866f81c8a | |
parent | 6c66de1ba5c6e2228ec3b0064dd298ae9e0e1125 (diff) | |
download | mandoc-90ee934d1309a0871b08fdb50a27fffcb1c6019e.tar.gz |
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).
-rw-r--r-- | man_term.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |