From 23902686a32d5f0812095462c567ccb3f768c7db Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Thu, 5 Jun 2014 19:46:22 -0400 Subject: Don't lose commodity when cost is not separated by whitespace When a cost was specified without a whitespace after the @ symbol, as in @$5.01, this was incorrectly parsed as 5.01 (losing the commodity) rather than $5.01. Bug fix for #1050 --- src/textual.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/textual.cc') 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(++next - line); - p = skip_ws(next); if (*p) { post->cost = amount_t(); -- cgit v1.2.3