summaryrefslogtreecommitdiff
path: root/src/textual.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/textual.cc')
-rw-r--r--src/textual.cc25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/textual.cc b/src/textual.cc
index 362bed4d..ab87a945 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -1732,7 +1732,30 @@ xact_t * instance_t::parse_xact(char * line,
// Parse the description text
if (next && *next) {
- char * p = next_element(next, true);
+ char * p = next;
+ std::size_t spaces = 0;
+ std::size_t tabs = 0;
+ while (*p) {
+ if (*p == ' ') {
+ ++spaces;
+ }
+ else if (*p == '\t') {
+ ++tabs;
+ }
+ else if (*p == ';' && (tabs > 0 || spaces > 1)) {
+ char *q = p - 1;
+ while (q > next && std::isspace(*q))
+ --q;
+ if (q > next)
+ *(q + 1) = '\0';
+ break;
+ }
+ else {
+ spaces = 0;
+ tabs = 0;
+ }
+ ++p;
+ }
xact->payee = context.journal->register_payee(next, xact.get());
next = p;
} else {