(parse_entry): Allow for the possibility that a transaction might end

with EOF.
This commit is contained in:
John Wiegley 2005-09-21 19:46:35 +00:00
parent c0d2ec851d
commit 4819302633

View file

@ -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);