summaryrefslogtreecommitdiff
path: root/src/textual.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2014-02-26 16:06:52 -0600
committerJohn Wiegley <johnw@newartisans.com>2014-02-26 16:06:52 -0600
commiteddd03ed096fc97a9b4f252ebbef0dae84410240 (patch)
tree0e8ec4c444700fd996eefead32455ec7086bff08 /src/textual.cc
parentbc08eed3cb1bdb4f67d1b77273f3254d0cf13be2 (diff)
parent75b0a5d8ff22abeac8c4f502154159f998ffbe99 (diff)
downloadfork-ledger-eddd03ed096fc97a9b4f252ebbef0dae84410240.tar.gz
fork-ledger-eddd03ed096fc97a9b4f252ebbef0dae84410240.tar.bz2
fork-ledger-eddd03ed096fc97a9b4f252ebbef0dae84410240.zip
Merge pull request #247 from ecraven/master
Adding support for recursive aliases.
Diffstat (limited to 'src/textual.cc')
-rw-r--r--src/textual.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/textual.cc b/src/textual.cc
index d8648c93..627a1835 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -977,6 +977,11 @@ void instance_t::account_alias_directive(account_t * account, string alias)
// (account), add a reference to the account in the `account_aliases'
// map, which is used by the post parser to resolve alias references.
trim(alias);
+ // Ensure that no alias like "alias Foo=Foo" is registered.
+ if ( alias == account->fullname()) {
+ throw_(parse_error, _f("Illegal alias %1%=%2%")
+ % alias % account->fullname());
+ }
std::pair<accounts_map::iterator, bool> result =
context.journal->account_aliases.insert
(accounts_map::value_type(alias, account));