Revision 66925c4a3abff28f8826399d55051c6c40ffbe42

evands at pidgin.im evands at pidgin.im
Tue Mar 13 06:45:40 EDT 2007


o   -----------------------------------------------------------------
|   Revision: 66925c4a3abff28f8826399d55051c6c40ffbe42
|   Ancestor: c15c01f5fe6de979e4327a88ac571475f7ea1296
|   Author: evands at pidgin.im
|   Date: 2007-03-12T22:58:03
|   Branch: im.pidgin.pidgin
|   
|   Modified files:
|           libpurple/protocols/msn/msn-utils.c
|   
|   ChangeLog: 
|   
|   Patch from plivesey, submitted in Adium Trac #5753 (http://trac.adiumx.com/ticket/5753), which fixes a memory stomper which occurred if the msn prpl were passed HTML with multiple style tags of the same type.  This doesn't happen in pidgin, because the gtkhtml widget knows that msn can only have one all-or-none instance of each style, but libpurple should be able to handle being passed any sort of HTML. This therefore fixes an Adium crash.
|   
|   ============================================================
|   --- libpurple/protocols/msn/msn-utils.c	c001fcb8c31329f5516e28c92c284ae1ee267892
|   +++ libpurple/protocols/msn/msn-utils.c	577ec40e49f6e69420b2a10fb1b50339d74e0792
|   @@ -174,6 +174,11 @@ msn_import_html(const char *html, char *
|    	char fonteffect[4];
|    	char fontcolor[7];
|    
|   +	gboolean haveBold = FALSE;
|   +	gboolean haveItalic = FALSE;
|   +	gboolean haveUnderline = FALSE;
|   +	gboolean haveStrikethrough = FALSE;
|   +
|    	g_return_if_fail(html       != NULL);
|    	g_return_if_fail(attributes != NULL);
|    	g_return_if_fail(message    != NULL);
|   @@ -197,22 +202,38 @@ msn_import_html(const char *html, char *
|    			}
|    			else if (!g_ascii_strncasecmp(c + 1, "i>", 2))
|    			{
|   -				strcat(fonteffect, "I");
|   +				if ( haveItalic == FALSE )
|   +				{
|   +					strcat(fonteffect, "I");
|   +					haveItalic = TRUE;
|   +				}
|    				c += 3;
|    			}
|    			else if (!g_ascii_strncasecmp(c + 1, "b>", 2))
|    			{
|   -				strcat(fonteffect, "B");
|   +				if ( haveBold == FALSE )
|   +				{
|   +					strcat(fonteffect, "B");
|   +					haveBold = TRUE;
|   +				}
|    				c += 3;
|    			}
|    			else if (!g_ascii_strncasecmp(c + 1, "u>", 2))
|    			{
|   -				strcat(fonteffect, "U");
|   +				if ( haveUnderline == FALSE )
|   +				{
|   +					strcat(fonteffect, "U");
|   +					haveUnderline = TRUE;
|   +				}
|    				c += 3;
|    			}
|    			else if (!g_ascii_strncasecmp(c + 1, "s>", 2))
|    			{
|   -				strcat(fonteffect, "S");
|   +				if ( haveStrikethrough == FALSE )
|   +				{
|   +					strcat(fonteffect, "S");
|   +					haveStrikethrough = TRUE;
|   +				}
|    				c += 3;
|    			}
|    			else if (!g_ascii_strncasecmp(c + 1, "a href=\"", 8))

To get the patch for this revision, please do this:
mtn log --last 1 --diffs --from 66925c4a3abff28f8826399d55051c6c40ffbe42


More information about the Commits mailing list