diff options
-rw-r--r-- | src/textual.cc | 5 | ||||
-rw-r--r-- | test/regress/1050.test | 39 |
2 files changed, 41 insertions, 3 deletions
diff --git a/src/textual.cc b/src/textual.cc index 418b6c00..8f37a566 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -1532,13 +1532,12 @@ post_t * instance_t::parse_post(char * line, post->add_flags(POST_COST_IN_FULL); DEBUG("textual.parse", "line " << context.linenum << ": " << "And it's for a total price"); + next++; } - if (post->has_flags(POST_COST_VIRTUAL) && *(next + 1) == ')') + if (post->has_flags(POST_COST_VIRTUAL) && *next == ')') ++next; - beg = static_cast<std::streamsize>(++next - line); - p = skip_ws(next); if (*p) { post->cost = amount_t(); diff --git a/test/regress/1050.test b/test/regress/1050.test new file mode 100644 index 00000000..a214e053 --- /dev/null +++ b/test/regress/1050.test @@ -0,0 +1,39 @@ + +D $1000.00 +D £1000.00 +D €1000.00 +D 1000.00 EUR + +2014-06-05 * Test + A 2 EUR @$1.37 + C + +2014-06-05 * Test + A 2 EUR @@£1.62 + C + +2014-06-05 * Test + A 2 EUR (@)€1.00 + C + +2014-06-05 * Test + A 2 EUR (@@)€2.00 + C + +test bal + 8.00 EUR A + $-2.74 + £-1.62 + €-4.00 C +-------------------- + $-2.74 + 8.00 EUR + £-1.62 + €-4.00 +end test + +test pricedb +P 2014/06/05 00:00:00 EUR $1.37 +P 2014/06/05 00:00:00 EUR £0.81 +end test + |