From: <rl...@us...> - 2006-11-20 05:33:35
|
Revision: 17790 http://svn.sourceforge.net/gaim/?rev=17790&view=rev Author: rlaager Date: 2006-11-19 21:33:32 -0800 (Sun, 19 Nov 2006) Log Message: ----------- Part of SF Patch #1599432 from Leonardo Fernandes "This patch ... solves a check for NULL that produced an error in the debug console." Modified Paths: -------------- trunk/COPYRIGHT trunk/libgaim/plugins/log_reader.c Modified: trunk/COPYRIGHT =================================================================== --- trunk/COPYRIGHT 2006-11-20 04:05:33 UTC (rev 17789) +++ trunk/COPYRIGHT 2006-11-20 05:33:32 UTC (rev 17790) @@ -103,6 +103,7 @@ Gábor Farkas Jesse Farmer Gavan Fantom (gavan) +Leonardo Fernandes David Fiander Rob Flynn <ga...@ro...> Rob Foehl (rwf) Modified: trunk/libgaim/plugins/log_reader.c =================================================================== --- trunk/libgaim/plugins/log_reader.c 2006-11-20 04:05:33 UTC (rev 17789) +++ trunk/libgaim/plugins/log_reader.c 2006-11-20 05:33:32 UTC (rev 17790) @@ -973,7 +973,8 @@ if (friendly_name != NULL) { int friendly_name_length = strlen(friendly_name); - int alias_length = log->account->alias ? strlen(log->account->alias) : 0; + const char *alias; + int alias_length; GaimBuddy *buddy = gaim_find_buddy(log->account, log->name); gboolean from_name_matches; gboolean to_name_matches; @@ -981,6 +982,17 @@ if (buddy && buddy->alias) their_name = buddy->alias; + if (log->account->alias) + { + alias = log->account->alias; + alias_length = strlen(alias); + } + else + { + alias = ""; + alias_length = 0; + } + /* Try to guess which user is me. * The first step is to determine if either of the names matches either my * friendly name or alias. For this test, "match" is defined as: @@ -988,13 +1000,13 @@ */ from_name_matches = (gaim_str_has_prefix(from_name, friendly_name) && !isalnum(*(from_name + friendly_name_length))) || - (gaim_str_has_prefix(from_name, log->account->alias) && + (gaim_str_has_prefix(from_name, alias) && !isalnum(*(from_name + alias_length))); to_name_matches = to_name != NULL && ( (gaim_str_has_prefix(to_name, friendly_name) && !isalnum(*(to_name + friendly_name_length))) || - (gaim_str_has_prefix(to_name, log->account->alias) && + (gaim_str_has_prefix(to_name, alias) && !isalnum(*(to_name + alias_length)))); if (from_name_matches) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |