From bc31e4838bae16748352901634d264af9b045369 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 17 Mar 2012 07:02:03 -0500 Subject: Fixed #711: Parsing of alias directive --- src/textual.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/textual.cc') diff --git a/src/textual.cc b/src/textual.cc index 8856af5d..0cb7fb81 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -982,27 +982,23 @@ 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); -#if defined(DEBUG_ON) std::pair result = -#endif context.journal->account_aliases.insert (accounts_map::value_type(alias, account)); -#if defined(DEBUG_ON) - assert(result.second); -#endif + if (! result.second) + (*result.first).second = account; } void instance_t::alias_directive(char * line) { - char * b = next_element(line); - if (char * e = std::strchr(b, '=')) { + if (char * e = std::strchr(line, '=')) { char * z = e - 1; while (std::isspace(*z)) *z-- = '\0'; *e++ = '\0'; e = skip_ws(e); - account_alias_directive(top_account()->find_account(e), b); + account_alias_directive(top_account()->find_account(e), line); } } -- cgit v1.2.3