From b98901664cfa7a54b2fd4c4a707eac8d17faaaa1 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 22 Jul 2005 23:02:25 +0000 Subject: (read_binary_journal, write_binary_journal): The "basket" account pointer was being incorrectly restored from the cache. --- binary.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/binary.cc b/binary.cc index 7f7d98e0..acc83d5b 100644 --- a/binary.cc +++ b/binary.cc @@ -11,7 +11,7 @@ namespace ledger { static unsigned long binary_magic_number = 0xFFEED765; -static unsigned long format_version = 0x00020037; +static unsigned long format_version = 0x00020039; static account_t ** accounts; static account_t ** accounts_next; @@ -390,7 +390,7 @@ unsigned int read_binary_journal(std::istream& in, accounts = accounts_next = new account_t *[a_count]; journal->master = read_binary_account(data, journal, master); if (read_binary_number(data)) - journal->basket = read_binary_account(data, journal); + journal->basket = accounts[read_binary_number(data) - 1]; // Allocate the memory needed for the entries and transactions in // one large block, which is then chopped up and custom constructed @@ -698,7 +698,7 @@ void write_binary_journal(std::ostream& out, journal_t * journal) if (journal->basket) { write_binary_number(out, true); - write_binary_account(out, journal->basket); + write_binary_number(out, journal->basket->ident); } else { write_binary_number(out, false); } -- cgit v1.2.3