summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-17 22:57:02 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-17 22:57:02 -0400
commit4414fddb00849132495b0a30938af0f296dee32f (patch)
tree154caa208de1f60f007a33a5ce0e2b2e82c32faa
parent4ec2dfeef13ead1d87302ef953e05efec102bb25 (diff)
downloadfork-ledger-4414fddb00849132495b0a30938af0f296dee32f.tar.gz
fork-ledger-4414fddb00849132495b0a30938af0f296dee32f.tar.bz2
fork-ledger-4414fddb00849132495b0a30938af0f296dee32f.zip
Fixed use of the -p flag without an interval
That is, -p 2004/01 is equivalent to "-b 2004/01/01 -e 2004/01/31" again.
-rw-r--r--src/filters.cc5
-rw-r--r--src/filters.h4
2 files changed, 5 insertions, 4 deletions
diff --git a/src/filters.cc b/src/filters.cc
index 276ecaba..5f7a79a1 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -527,10 +527,11 @@ void interval_xacts::operator()(xact_t& xact)
}
interval.begin = quant;
}
+ subtotal_xacts::operator()(xact);
+ } else {
+ item_handler<xact_t>::operator()(xact);
}
- subtotal_xacts::operator()(xact);
-
last_xact = &xact;
}
diff --git a/src/filters.h b/src/filters.h
index 66d0dd2e..d5636796 100644
--- a/src/filters.h
+++ b/src/filters.h
@@ -598,8 +598,8 @@ public:
}
void report_subtotal() {
- assert(last_xact);
- subtotal_xacts::report_subtotal();
+ if (last_xact && interval)
+ subtotal_xacts::report_subtotal();
last_xact = NULL;
}