diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2021-09-07 17:07:58 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2021-09-07 17:07:58 +0000 |
commit | 1db067df52b2cf1bc3a5196fc4a62bab34cb69e4 (patch) | |
tree | 19334aef3ffabddbd278e9b9d31cab95b278161f /regress/mdoc/Os | |
parent | 5947e2465bef7a2766d48ca273c0aaa7b5dce3d2 (diff) | |
download | mandoc-1db067df52b2cf1bc3a5196fc4a62bab34cb69e4.tar.gz |
Fix an infinite loop that could occur during some cases of horizontally
overlapping horizontal spans. One span would calculate a desired
target width and start preparations for applying it to some columns,
then the other span would overwrite the target width with a different
value and also start preparations for applying that one to some
columns, which could sometimes confuse the code doing the final
distribution to the point of not doing anything at all before
entering the next iteration.
Fix this by making sure the distribution is done step by step, doing
one step at a time rather than allowing multiple steps to conflict.
Specifically, always do the smallest useful step first. This change
also simplifies the code. For example, the local "colwidth" array
is no longer needed.
Note that the algorithm still differs from the one implemented in
GNU tbl(1), which appears to not even try to harmonize column widths
but seems to simply distribute the same amount to all constituent
columns, no matter whether their intrinsic width is narrow or wide.
Adopting a GNU-compatible algorithm might allow further simplifiction
in addition to yielding even more similar output, but i do not want
to implement any major changes of the algorithm at this time.
The infinite loop was reported by <Oliver dot Corff at email dot de>.
Diffstat (limited to 'regress/mdoc/Os')
0 files changed, 0 insertions, 0 deletions