summaryrefslogtreecommitdiff
path: root/textual.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-09-17 05:11:51 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-09-17 05:11:51 -0400
commit3c6fd0f80492b609e7520fe1609d4e5f9f4bd503 (patch)
tree0170a5ea6399dc330a01dbe8821086b14145ff86 /textual.cc
parent9307c87c952ee4752c04498bf68bc07b776e6d8a (diff)
downloadfork-ledger-3c6fd0f80492b609e7520fe1609d4e5f9f4bd503.tar.gz
fork-ledger-3c6fd0f80492b609e7520fe1609d4e5f9f4bd503.tar.bz2
fork-ledger-3c6fd0f80492b609e7520fe1609d4e5f9f4bd503.zip
If '[TEXT]' found in a transaction note fails to parse as a date, ignore it.
Fixes: 96DDA4B9-E216-4C7A-8D0E-02B0F39CA256
Diffstat (limited to 'textual.cc')
-rw-r--r--textual.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/textual.cc b/textual.cc
index bc56d6de..d711005b 100644
--- a/textual.cc
+++ b/textual.cc
@@ -307,12 +307,17 @@ transaction_t * parse_transaction(char * line, account_t * account,
DEBUG_PRINT("ledger.textual.parse", "line " << linenum << ": " <<
"Parsed a transaction date " << buf);
- if (char * p = std::strchr(buf, '=')) {
- *p++ = '\0';
- xact->_date_eff = p;
+ try {
+ if (char * p = std::strchr(buf, '=')) {
+ *p++ = '\0';
+ xact->_date_eff = p;
+ }
+ if (buf[0])
+ xact->_date = buf;
+ }
+ catch (...) {
+ // If it fails to parse, just ignore it...
}
- if (buf[0])
- xact->_date = buf;
}
}
}