summaryrefslogtreecommitdiff
path: root/btree.pl
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-05-15 16:10:57 +0200
committerYorhel <git@yorhel.nl>2019-05-15 16:10:57 +0200
commitb4b299b6d6c3463f86e3980d5fd3116a82a24ff3 (patch)
tree29ea4d3ab70c7f21626f1aeadbc6c718eeb662a6 /btree.pl
parent04719fb0dd62858f97996f791a2318e062b90544 (diff)
btree.pl: Fix bug with flushing references to the final nodes
Diffstat (limited to 'btree.pl')
-rwxr-xr-xbtree.pl2
1 files changed, 1 insertions, 1 deletions
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);
}