diff options
author | Martin Michlmayr <tbm@cyrius.com> | 2014-06-05 19:46:22 -0400 |
---|---|---|
committer | Martin Michlmayr <tbm@cyrius.com> | 2014-06-05 19:46:22 -0400 |
commit | 23902686a32d5f0812095462c567ccb3f768c7db (patch) | |
tree | 305a7f46ab6f687edd63241d32230ff59669c4fc /src/textual.cc | |
parent | f577dc4edc80aa8fc43fef70e023c2d40ee935ef (diff) | |
download | fork-ledger-23902686a32d5f0812095462c567ccb3f768c7db.tar.gz fork-ledger-23902686a32d5f0812095462c567ccb3f768c7db.tar.bz2 fork-ledger-23902686a32d5f0812095462c567ccb3f768c7db.zip |
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
Diffstat (limited to 'src/textual.cc')
-rw-r--r-- | src/textual.cc | 5 |
1 files changed, 2 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(); |