If '[TEXT]' found in a transaction note fails to parse as a date, ignore it.

Fixes: 96DDA4B9-E216-4C7A-8D0E-02B0F39CA256
This commit is contained in:
John Wiegley 2008-09-17 05:11:51 -04:00
parent 9307c87c95
commit 3c6fd0f804
2 changed files with 452 additions and 459 deletions

896
TODO

File diff suppressed because it is too large Load diff

View file

@ -307,6 +307,7 @@ transaction_t * parse_transaction(char * line, account_t * account,
DEBUG_PRINT("ledger.textual.parse", "line " << linenum << ": " << DEBUG_PRINT("ledger.textual.parse", "line " << linenum << ": " <<
"Parsed a transaction date " << buf); "Parsed a transaction date " << buf);
try {
if (char * p = std::strchr(buf, '=')) { if (char * p = std::strchr(buf, '=')) {
*p++ = '\0'; *p++ = '\0';
xact->_date_eff = p; xact->_date_eff = p;
@ -314,6 +315,10 @@ transaction_t * parse_transaction(char * line, account_t * account,
if (buf[0]) if (buf[0])
xact->_date = buf; xact->_date = buf;
} }
catch (...) {
// If it fails to parse, just ignore it...
}
}
} }
} }