Skip to content

Commit

Permalink
Trap AutoIndex bug when no lines to process (#1280)
Browse files Browse the repository at this point in the history
Attempting to run HTML -> AutoIndex when there are no
non-blank lines before the end of file, e.g. on empty file, caused
an infinite loop
  • Loading branch information
windymilla authored Nov 28, 2023
1 parent 529d91e commit 99ac441
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/Guiguts/HTMLConvert.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3289,8 +3289,11 @@ sub autoindex {
my $first = 1;
my $indent = 0;

my $endstep = $textwindow->index('end');
$endstep =~ s/\..*//;
while ( $textwindow->get( "$step.0", "$step.end" ) eq '' ) {
$step++;
return if $step >= $endstep;
}
while ( $step <= $ler ) {
my $selection = $textwindow->get( "$step.0", "$step.end" );
Expand Down

0 comments on commit 99ac441

Please sign in to comment.