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

File: [cvsweb.bsd.lv] / mandoc / regress / roff / po / range.out_ascii (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.

PO-RANGE(1)                 General Commands Manual                PO-RANGE(1)

NNAAMMEE
     ppoo--rraannggee - page offsets out of range

DDEESSCCRRIIPPTTIIOONN
     initial text

too small

     back in range

                                                                 too large

               back in range

     final text

OpenBSD                        September 3, 2020                       OpenBSD