diff options
author | Karl Williamson <khw@cpan.org> | 2022-05-15 14:28:31 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-05-15 14:35:14 -0600 |
commit | d788e6759c91f4bd376ebe62fc985f37d317295b (patch) | |
tree | 18a625f85ede0414231d9fd7cad9a51ff9dea1db /autodoc.pl | |
parent | 2ab86d4ccc1d7d8cf04590ca7c73d7a436d1e162 (diff) | |
download | perl-d788e6759c91f4bd376ebe62fc985f37d317295b.tar.gz |
autodoc.pl: Properly handle a single column
The program attempts to make a table of some of the output for
compactness. But if there is room for only a single column, it was
using the number of rows that it calculated were necessary should two
columns have worked; hence the output was only displaying the first half
of the rows in perlintern.pod. What is needed is to do the loop a
partial final iteration, just enough to calculate the number of rows for
that final column.
Diffstat (limited to 'autodoc.pl')
-rw-r--r-- | autodoc.pl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/autodoc.pl b/autodoc.pl index 92a4a9c1fc..0b8f361eff 100644 --- a/autodoc.pl +++ b/autodoc.pl @@ -1560,12 +1560,16 @@ sub construct_missings_section { # can accommodate all the data. This algorithm doesn't require the # resulting columns to all have the same width. This can allow for # as tight of packing as the data will possibly allow. - for ($columns = 7; $columns > 1; $columns--) { + for ($columns = 7; $columns >= 1; $columns--) { # For this many columns, we will need this many rows (final row might # not be completely filled) $rows = (@missings + $columns - 1) / $columns; + # We only need to execute this final iteration to calculate the number + # of rows, as we can't get fewer than a single column. + last if $columns == 1; + my $row_width = 1; # For 1 space indent my $i = 0; # Which missing element |