From b4b299b6d6c3463f86e3980d5fd3116a82a24ff3 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Wed, 15 May 2019 16:10:57 +0200 Subject: btree.pl: Fix bug with flushing references to the final nodes --- btree.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btree.pl b/btree.pl index 04bb168..fb792bf 100755 --- a/btree.pl +++ b/btree.pl @@ -73,7 +73,7 @@ sub encode { my $str = $nodes[$i] =~ s/^([^\x00]*)\x00// && $1; $ref = writeblock $nodes[$i], 0; $nodes[$i] = ''; - if($minsize) { + if($minsize || $nodes[$i+1]) { $nodes[$i+1] ||= ''; $nodes[$i+1] .= "$str\x00".eref($ref); } -- cgit v1.2.3