aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2021-09-07 17:07:58 +0000
committerIngo Schwarze <schwarze@openbsd.org>2021-09-07 17:07:58 +0000
commit4d57526007f1149e2246b6764cb5b6551d14b65b (patch)
treea78ae675df648ea4e3ddf39260e2558ea65a180f /html.c
parent75a58ff911d520ea8c88e364a1303f81abb898cf (diff)
downloadmandoc-4d57526007f1149e2246b6764cb5b6551d14b65b.tar.gz
mandoc-4d57526007f1149e2246b6764cb5b6551d14b65b.tar.zst
mandoc-4d57526007f1149e2246b6764cb5b6551d14b65b.zip
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 'html.c')
0 files changed, 0 insertions, 0 deletions