diff options
author | John Wiegley <johnw@newartisans.com> | 2004-08-19 20:54:19 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-08-19 20:54:19 -0400 |
commit | 9d4f8392632481ce5e174a4ebe52d4cb339b95dc (patch) | |
tree | 8832073e43e605792098a7b20aaaaee6f881603e | |
parent | 7e2af9b73d8ce594ef0a4d9dee0d940809ef4b6a (diff) | |
download | fork-ledger-9d4f8392632481ce5e174a4ebe52d4cb339b95dc.tar.gz fork-ledger-9d4f8392632481ce5e174a4ebe52d4cb339b95dc.tar.bz2 fork-ledger-9d4f8392632481ce5e174a4ebe52d4cb339b95dc.zip |
the QIF parser was too order dependent
-rw-r--r-- | qif.cc | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -31,6 +31,10 @@ unsigned int parse_qif_file(std::istream& in, journal_t * journal, account_t * misc = journal->find_account("Miscellaneous"); unsigned int count; + entry.reset(new entry_t); + xact = new transaction_t(master); + entry->add_transaction(xact); + path = journal->sources.back(); linenum = 1; @@ -65,10 +69,6 @@ unsigned int parse_qif_file(std::istream& in, journal_t * journal, break; case 'D': - entry.reset(new entry_t); - xact = new transaction_t(master); - entry->add_transaction(xact); - in >> line; if (! parse_date(line, &entry->date)) throw parse_error(path, linenum, "Failed to parse date"); @@ -150,6 +150,10 @@ unsigned int parse_qif_file(std::istream& in, journal_t * journal, if (journal->add_entry(entry.release())) count++; + + entry.reset(new entry_t); + xact = new transaction_t(master); + entry->add_transaction(xact); break; } } |