From 2835be562889c4e4dd11205533cca54ae02042e1 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 9 Oct 2003 01:19:46 +0000 Subject: *** empty log message *** --- reports.cc | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'reports.cc') diff --git a/reports.cc b/reports.cc index da33f42f..b46d360e 100644 --- a/reports.cc +++ b/reports.cc @@ -167,23 +167,8 @@ static std::string truncated(const std::string& str, int width) void print_register(const std::string& acct_name, std::ostream& out, regexps_map& regexps) { - account * acct = NULL; mask acct_regex(acct_name); - for (accounts_map_iterator i = main_ledger->accounts.begin(); - i != main_ledger->accounts.end(); - i++) - if (acct_regex.match((*i).second->as_str())) { - acct = (*i).second; - break; - } - - if (! acct) { - std::cerr << "Error: Unknown account name: " << acct_name - << std::endl; - return; - } - // Walk through all of the ledger entries, printing their register // formatted equivalent @@ -198,7 +183,8 @@ void print_register(const std::string& acct_name, std::ostream& out, for (std::list::iterator x = (*i)->xacts.begin(); x != (*i)->xacts.end(); x++) { - if ((*x)->acct != acct || ! show_cleared && (*i)->cleared) + if (! acct_regex.match((*x)->acct->as_str()) || + ! show_cleared && (*i)->cleared) continue; char buf[32]; -- cgit v1.2.3