From: b Date: Sat, 14 Oct 2023 22:18:12 +0000 (+0000) Subject: fix bbcode conversion index runaway X-Git-Tag: v1.0.0~49 X-Git-Url: http://bicyclesonthemoon.info/git-projects/?a=commitdiff_plain;h=e1acf68fa531d00870b396260bf2b47bdf37cd31;p=botm%2Foldlogs fix bbcode conversion index runaway --- diff --git a/bsta_lib.1.pm b/bsta_lib.1.pm index 95f54a6..6076982 100644 --- a/bsta_lib.1.pm +++ b/bsta_lib.1.pm @@ -18,6 +18,7 @@ # along with this program. If not, see . # TODO: FQ NBSP ? +# TODO: DEBUG package bsta_lib; @@ -551,7 +552,7 @@ sub convtree { $ind =~ s/\.([0-9]+)$//; $level -= 1; $debug .= debug($printdebug, "[<]"); - if ($level >= 0) { + if ($level > 0) { $goto_next = 'nd'; } else { @@ -622,7 +623,7 @@ sub convtree { {do{ $ind =~ s/\.([0-9]+)$//; my $i = int($1) + 1; - if ($i < $bbtree->{$ind.'.count'}){ + if (($i < $bbtree->{$ind.'.count'}) and ($1 ne '')){ # goto next $ind = $ind.'.'.$i; last;