Fixed a problem with accounts and trailing spaces

This issue is caused by having a single space at the end of a posting
that has neither an amount nor a note.

Fixes C523E23F-CFAC-4A53-B0C6-21226640E763
This commit is contained in:
John Wiegley 2009-06-16 17:05:28 +01:00
parent 298a4faef3
commit 94467e5b7f
2 changed files with 24 additions and 0 deletions

View file

@ -863,6 +863,9 @@ post_t * instance_t::parse_post(char * line,
char * next = next_element(p, true); char * next = next_element(p, true);
char * e = p + std::strlen(p); char * e = p + std::strlen(p);
while (e > p && std::isspace(*(e - 1)))
e--;
if ((*p == '[' && *(e - 1) == ']') || (*p == '(' && *(e - 1) == ')')) { if ((*p == '[' && *(e - 1) == ']') || (*p == '(' && *(e - 1) == ')')) {
post->add_flags(POST_VIRTUAL); post->add_flags(POST_VIRTUAL);
DEBUG("textual.parse", "line " << linenum << ": " DEBUG("textual.parse", "line " << linenum << ": "

View file

@ -0,0 +1,21 @@
bal
<<<
D 1.000,00€
2009/03/16 * denn's
; Kauf: Yogi-Tee
Aufwand:Einkauf:Lebensmittel 17,94€
Aktiva:Bank:Girokonto
2009/03/24 Ansparen
Aktiva:Bank:Sparkonto 800,00€
Aktiva:Bank:Girokonto
>>>1
-17,94€ Aktiva:Bank
-817,94€ Girokonto
800,00€ Sparkonto
17,94€ Aufwand:Einkauf:Lebensmittel
--------------------
0
>>>2
=== 0