From c80b4955467a38a2be3aaaa60c9f49b33edef774 Mon Sep 17 00:00:00 2001 From: Peter Feigl Date: Tue, 25 Feb 2014 22:50:20 +0100 Subject: Adding support for recursive aliases. Alias expansion is now a loop. If you define alias A=B:A alias B=C:B then A will expand to C:B:A. Also added a short section to the manual about this. --- src/textual.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/textual.cc') 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 result = context.journal->account_aliases.insert (accounts_map::value_type(alias, account)); -- cgit v1.2.3