diff options
author | John Wiegley <johnw@newartisans.com> | 2003-10-09 01:19:46 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2003-10-09 01:19:46 +0000 |
commit | 2835be562889c4e4dd11205533cca54ae02042e1 (patch) | |
tree | 8bcd6823bd699b7d2b0c2db889703902a1c7eb7e /reports.cc | |
parent | 73744e9d266003344f01d2ba63e159f0c3a2b314 (diff) | |
download | fork-ledger-2835be562889c4e4dd11205533cca54ae02042e1.tar.gz fork-ledger-2835be562889c4e4dd11205533cca54ae02042e1.tar.bz2 fork-ledger-2835be562889c4e4dd11205533cca54ae02042e1.zip |
*** empty log message ***
Diffstat (limited to 'reports.cc')
-rw-r--r-- | reports.cc | 18 |
1 files changed, 2 insertions, 16 deletions
@@ -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<transaction *>::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]; |