summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qif.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/qif.cc b/qif.cc
index 77dc791a..64c4223e 100644
--- a/qif.cc
+++ b/qif.cc
@@ -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;
}
}