summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2014-05-17 19:28:44 -0500
committerJohn Wiegley <johnw@newartisans.com>2014-05-17 19:28:44 -0500
commit0f9d558bbf4a93559a8af24b4d4b0ceee39ecde1 (patch)
tree29a9371d57eaf726cc6f979df67d7233843319dc /src
parent9dba3f065447aaaca87150e42070c538ae96d3a2 (diff)
parent8b3f8d188444510d8ca00e5db90bac0cf5663c91 (diff)
downloadfork-ledger-0f9d558bbf4a93559a8af24b4d4b0ceee39ecde1.tar.gz
fork-ledger-0f9d558bbf4a93559a8af24b4d4b0ceee39ecde1.tar.bz2
fork-ledger-0f9d558bbf4a93559a8af24b4d4b0ceee39ecde1.zip
Merge pull request #295 from thdox/fix-regression-from-aa2ff2b
Fix bug introduced by commit AA2FF2B
Diffstat (limited to 'src')
-rw-r--r--src/textual.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/textual.cc b/src/textual.cc
index 8d4db512..418b6c00 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -1638,24 +1638,23 @@ post_t * instance_t::parse_post(char * line,
"line " << context.linenum << ": " << "post amount = " << amt);
amount_t diff = amt;
- amount_t tot;
switch (account_total.type()) {
case value_t::AMOUNT:
- tot = account_total.as_amount();
+ diff -= account_total.as_amount();
break;
case value_t::BALANCE:
if (optional<amount_t> comm_bal =
account_total.as_balance().commodity_amount(amt.commodity()))
- tot = *comm_bal;
+ diff -= *comm_bal;
break;
default:
break;
}
- diff -= tot;
+ amount_t tot = amt - diff;
DEBUG("post.assign",
"line " << context.linenum << ": " << "diff = " << diff);