summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-30 05:29:34 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-30 05:29:34 -0400
commit305c6159afe727c6e6f2f49c37789922df1a5a98 (patch)
tree7ec61636d9b3439314ee8f22ccffe733d6d94462
parenta54030a486676cca8068538d2701d5beda8c04fa (diff)
downloadfork-ledger-305c6159afe727c6e6f2f49c37789922df1a5a98.tar.gz
fork-ledger-305c6159afe727c6e6f2f49c37789922df1a5a98.tar.bz2
fork-ledger-305c6159afe727c6e6f2f49c37789922df1a5a98.zip
small fixes
-rwxr-xr-xacprep2
-rw-r--r--textual.cc11
2 files changed, 10 insertions, 3 deletions
diff --git a/acprep b/acprep
index ba5706bb..a1a5ea16 100755
--- a/acprep
+++ b/acprep
@@ -23,7 +23,7 @@ if [ "$1" = "--debug" ]; then
elif [ "$1" = "--opt" ]; then
./configure CPPFLAGS="$INCDIRS" LDFLAGS="$LIBDIRS" \
CXXFLAGS="-fomit-frame-pointer -fastf -mcpu=7450 -fPIC" \
- --enable-standalone
+ --enable-standalone --disable-shared
elif [ "$1" = "--perf" ]; then
./configure CPPFLAGS="$INCDIRS" LDFLAGS="$LIBDIRS" CXXFLAGS="-g -pg"
fi
diff --git a/textual.cc b/textual.cc
index 1c50d725..b066fdd0 100644
--- a/textual.cc
+++ b/textual.cc
@@ -148,14 +148,21 @@ bool finalize_entry(entry_t * entry)
value_t balance;
+ bool first = true;
for (transactions_list::const_iterator x = entry->transactions.begin();
x != entry->transactions.end();
x++)
if (! ((*x)->flags & TRANSACTION_VIRTUAL) ||
((*x)->flags & TRANSACTION_BALANCE)) {
amount_t * p = (*x)->cost ? (*x)->cost : &(*x)->amount;
- if (*p)
- balance += *p;
+ if (*p) {
+ if (first) {
+ balance = *p;
+ first = false;
+ } else {
+ balance += *p;
+ }
+ }
}
// If one transaction of a two-line transaction is of a different