# HG changeset patch # User Richard Laager # Date 1144702503 0 # Node ID 723fd573111c5f4dca193b6faf43fb9a0325f304 # Parent dd03aa8a28ad24cb23f9acc040ee18cb8dfe4cc0 [gaim-migrate @ 15999] Refactor the codeflow of gaim_normalize() slightly so that it's easier to read. committer: Tailor Script diff -r dd03aa8a28ad -r 723fd573111c src/util.c --- a/src/util.c Mon Apr 10 20:51:51 2006 +0000 +++ b/src/util.c Mon Apr 10 20:55:03 2006 +0000 @@ -2612,20 +2612,22 @@ const char * gaim_normalize(const GaimAccount *account, const char *str) { - GaimPlugin *prpl = NULL; - GaimPluginProtocolInfo *prpl_info = NULL; const char *ret = NULL; - if(account) - prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); - - if(prpl) - prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); - - if(prpl_info && prpl_info->normalize) - ret = prpl_info->normalize(account, str); - - if(!ret) + if (account == NULL) + { + GaimPlugin *prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); + + if (prpl != NULL) + { + GaimPluginProtocolInfo *prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); + + if(prpl_info && prpl_info->normalize) + ret = prpl_info->normalize(account, str); + } + } + + if (ret != NULL) { static char buf[BUF_LEN]; char *tmp;