summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile9
-rw-r--r--ledger.cc10
-rw-r--r--reports.cc2
3 files changed, 12 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 19ac1f7a..adb62b03 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,16 @@
CODE = amount.cc ledger.cc parse.cc reports.cc
OBJS = $(patsubst %.cc,%.o,$(CODE))
CFLAGS = -Wall -ansi -pedantic
-#DFLAGS = -O3 -fomit-frame-pointer -mcpu=pentium
+DFLAGS = -O3 -fomit-frame-pointer -mcpu=pentium
#DFLAGS = -g -DDEBUG=1
-DFLAGS = -O2
INCS =
LIBS = -lgmpxx -lgmp -lpcre
ifdef GNUCASH
-CODE := $(CODE) gnucash.cc
+CODE := $(CODE) gnucash.cc
CFLAGS := $(CFLAGS) -DREAD_GNUCASH=1
-INCS := $(INCS) -I/usr/include/xmltok
-LIBS := $(LIBS) -lxmlparse
+INCS := $(INCS) -I/usr/include/xmltok
+LIBS := $(LIBS) -lxmlparse
endif
all: make.deps ledger ledger.info
diff --git a/ledger.cc b/ledger.cc
index fe05d19b..b77b8856 100644
--- a/ledger.cc
+++ b/ledger.cc
@@ -323,9 +323,13 @@ bool matches(const regexps_map& regexps, const std::string& str,
// << (match ? "match" : "not match") << std::endl;
}
- if (match && ! definite && by_exclusion) {
-// out << " Note: Matched by exclusion rule" << std::endl;
- *by_exclusion = true;
+ if (by_exclusion) {
+ if (match && ! definite && by_exclusion) {
+// out << " Note: Matched by exclusion rule" << std::endl;
+ *by_exclusion = true;
+ } else {
+ *by_exclusion = false;
+ }
}
// out << " Final result: " << (match ? "match" : "not match")
diff --git a/reports.cc b/reports.cc
index 920967ef..da33f42f 100644
--- a/reports.cc
+++ b/reports.cc
@@ -100,7 +100,7 @@ void report_balances(std::ostream& out, regexps_map& regexps)
acct->checked = 1;
}
else {
- bool by_exclusion;
+ bool by_exclusion = false;
bool match = matches(regexps, acct->as_str(),
&by_exclusion);
if (! match) {