From e1acf68fa531d00870b396260bf2b47bdf37cd31 Mon Sep 17 00:00:00 2001 From: b Date: Sat, 14 Oct 2023 22:18:12 +0000 Subject: [PATCH] fix bbcode conversion index runaway --- bsta_lib.1.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- 2.30.2