diff options
author | John Wiegley <johnw@newartisans.com> | 2005-09-21 19:46:35 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:41:18 -0400 |
commit | 4819302633e8a7a28176b45f6e99db0827c8a544 (patch) | |
tree | cb4836ebfdced1305d7bcd6fa4d8e42e52cb1a2b /textual.cc | |
parent | c0d2ec851db2aa1a0f9ab0df042b9f280db52425 (diff) | |
download | ledger-4819302633e8a7a28176b45f6e99db0827c8a544.tar.gz ledger-4819302633e8a7a28176b45f6e99db0827c8a544.tar.bz2 ledger-4819302633e8a7a28176b45f6e99db0827c8a544.zip |
(parse_entry): Allow for the possibility that a transaction might end
with EOF.
Diffstat (limited to 'textual.cc')
-rw-r--r-- | textual.cc | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -338,17 +338,23 @@ entry_t * parse_entry(std::istream& in, char * line, account_t * master, TIMER_START(entry_xacts); while (! in.eof() && (in.peek() == ' ' || in.peek() == '\t')) { + line[0] = '\0'; in.getline(line, MAX_LINE); - if (in.eof()) + if (in.eof() && line[0] == '\0') break; + linenum++; if (line[0] == ' ' || line[0] == '\t' || line[0] == '\r') { char * p = skip_ws(line); if (! *p || *p == '\r') break; } + if (transaction_t * xact = parse_transaction(line, master)) curr->add_transaction(xact); + + if (in.eof()) + break; } TIMER_STOP(entry_xacts); |