pidgin: 7464e6a7: The MSN client and server strips leading...

qulogic at pidgin.im qulogic at pidgin.im
Mon Jul 13 02:01:07 EDT 2009


-----------------------------------------------------------------
Revision: 7464e6a7cd486b83bbd919dde287ca04a5a711ce
Ancestor: ef79c36c100c597720e427357062efcce8e6d2c5
Author: qulogic at pidgin.im
Date: 2009-07-12T05:06:45
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/7464e6a7cd486b83bbd919dde287ca04a5a711ce

Modified files:
        libpurple/protocols/msn/msn.c

ChangeLog: 

The MSN client and server strips leading and trailing whitespace, so do the
same locally before setting it, so that people don't think that their name
actually included any.

Also, there's no need to call strlen() to check that the length > 0.

Fixes #9447 in a way.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msn.c	eb8a3e14a6f0090059f05f39fde2b9200edbaaf4
+++ libpurple/protocols/msn/msn.c	141cb6b20bfce197acf36b433fe9068fe2140217
@@ -178,8 +178,12 @@ msn_act_id(PurpleConnection *gc, const c
 	cmdproc = session->notification->cmdproc;
 	account = purple_connection_get_account(gc);
 
-	if(entry && strlen(entry))
-		alias = purple_url_encode(entry);
+	if (entry && *entry)
+	{
+		char *tmp = g_strdup(entry);
+		alias = purple_url_encode(g_strstrip(tmp));
+		g_free(tmp);
+	}
 	else
 		alias = "";
 
@@ -195,7 +199,6 @@ msn_act_id(PurpleConnection *gc, const c
 	}
 
 	msn_cmdproc_send(cmdproc, "PRP", "MFN %s", alias);
-
 }
 
 static void


More information about the Commits mailing list