]> bicyclesonthemoon.info Git - ott/bsta/commitdiff
fix bbcode conversion index runaway
authorb <rowerynaksiezycu@gmail.com>
Sat, 14 Oct 2023 22:18:12 +0000 (22:18 +0000)
committerb <rowerynaksiezycu@gmail.com>
Sat, 14 Oct 2023 22:18:12 +0000 (22:18 +0000)
bsta_lib.1.pm

index 95f54a6253ae7a9ef6e39ef58f5ba9fcb0de3ed5..60769828791b932130da1dfc4c62cf925691085c 100644 (file)
@@ -18,6 +18,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # 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;