[BACK]Return to range.in CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc / regress / roff / po

File: [cvsweb.bsd.lv] / mandoc / regress / roff / po / range.in (download)

Revision 1.1, Thu Sep 3 20:43:16 2020 UTC (3 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_6, HEAD

Fix two issues with .po (page offset) formatting:
1. Truncate excessive offsets to a width reasonable in the context
of manual pages instead of printing excessively long lines
and sometimes causing assertion failures;
found in an afl run performed by Jan Schreiber <jes at posteo dot de>.
2. Remember both the requested and the applied page offset; otherwise,
subtracting an excessive width, then adding it again, would end up
with an incorrectly large offset.
While here, simplify the code by reverting the previous offset up front,
and also add some comments to make the general ideas easier to understand.

.\" $OpenBSD: range.in,v 1.1 2020/09/03 20:33:20 schwarze Exp $
.Dd $Mdocdate: September 3 2020 $
.Dt PO-RANGE 1
.Os
.Sh NAME
.Nm po-range
.Nd page offsets out of range
.Sh DESCRIPTION
initial text
.Pp
.po -10n
too small
.Pp
.po +10n
back in range
.Pp
.po 80n
too large
.Pp
.po -70n
back in range
.Pp
.po 0
final text