diff options
author | Craig Earls <enderw88@gmail.com> | 2013-01-14 21:56:33 -0800 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2013-01-14 21:56:33 -0800 |
commit | 856f4b673c7cd8235c5647ebad86b1a5fb25739b (patch) | |
tree | ca367d1a79e2ce983e218d23c3d14466825b9a94 /src/journal.cc | |
parent | 67a598f6ff3b9b19b08af108c8bfe26064728457 (diff) | |
parent | d4df36a5983ee5ee8ee56c14f3decdcad6faf8af (diff) | |
download | fork-ledger-856f4b673c7cd8235c5647ebad86b1a5fb25739b.tar.gz fork-ledger-856f4b673c7cd8235c5647ebad86b1a5fb25739b.tar.bz2 fork-ledger-856f4b673c7cd8235c5647ebad86b1a5fb25739b.zip |
Merge remote-tracking branch 'upstream/next' into next
Diffstat (limited to 'src/journal.cc')
-rw-r--r-- | src/journal.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/journal.cc b/src/journal.cc index e6c09125..f45b7527 100644 --- a/src/journal.cc +++ b/src/journal.cc @@ -127,8 +127,19 @@ account_t * journal_t::register_account(const string& name, post_t * post, // object. if (account_aliases.size() > 0) { accounts_map::const_iterator i = account_aliases.find(name); - if (i != account_aliases.end()) + if (i != account_aliases.end()) { result = (*i).second; + } else { + // only check the very first account for alias expansion, in case + // that can be expanded successfully + size_t colon = name.find(':'); + if(colon != string::npos) { + accounts_map::const_iterator i = account_aliases.find(name.substr(0, colon)); + if (i != account_aliases.end()) { + result = find_account((*i).second->fullname() + name.substr(colon)); + } + } + } } // Create the account object and associate it with the journal; this |