From a1717b6dd5465f14f53a1c2ff92a32c31d8635c1 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 23 Nov 2008 23:37:01 -0400 Subject: [PATCH] Needed to port skanthak's last commit to the master branch's code base. --- src/reconcile.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/reconcile.cc b/src/reconcile.cc index 9b965ac4..2c95023d 100644 --- a/src/reconcile.cc +++ b/src/reconcile.cc @@ -44,11 +44,16 @@ static bool search_for_balance(amount_t& amount, *prev = next; amount -= next->amount; + if (! amount) { - transaction_xdata(*next).ptr = NULL; + *xact_next_ptr(next) = NULL; return true; - } else if (search_for_balance(amount, xact_next_ptr(next), xact_next(next))) + } + else if (search_for_balance(amount, xact_next_ptr(next), xact_next(next))) + { return true; + } + amount += next->amount; *prev = temp;