CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2026/01/06 14:16:12
Modified files:
usr.bin/mandoc : term.c term.h term_ascii.c term_ps.c
Log message:
Strangely, groff accepts .ll arguments with multiple signs. For odd numbers
of minus signs, the intended behaviour is decreasing the line length, for
even numbers, increasing it. The code in term_setwidth() resulted in
incorrect behaviour in two cases: for more than two signs, the line length
wasn't changed at all because a2roffsu() was called incorrectly and failed,
and if the second sign was negative, a negative width was passed to the
setwidth() callbacks, which they aren't prepared to handle.
Fix this by iterating over all signs to find the correct iop operation
code (0=absolute, 1=increase, -1=decrease). Also improve code clarity
by making the width argument of the setwidth() callbacks unsigned and
removing some ugly casts in these callbacks.