changeset 16779:e3f4f1fd8f3d

merge of '92952767b5290dd3324e325476ad8aecd0e2a3f1' and 'edbf1afe63dd8077f9c4287f723010c769239720'
author Evan Schoenberg <evan.s@dreskin.net>
date Wed, 02 May 2007 11:55:04 +0000
parents b63ef2b2acfc (current diff) a9975d6c2832 (diff)
children 2ff9195a35ce
files
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/bonjour/bonjour.c	Wed May 02 07:04:07 2007 +0000
+++ b/libpurple/protocols/bonjour/bonjour.c	Wed May 02 11:55:04 2007 +0000
@@ -460,6 +460,7 @@
 	const char *fullname = NULL;
 #endif
 	char *splitpoint = NULL;
+	char *tmp;
 	char hostname[255];
 
 #ifndef _WIN32
@@ -545,7 +546,16 @@
 	if (splitpoint != NULL)
 	{
 		default_firstname = g_strndup(fullname, splitpoint - fullname);
-		default_lastname = g_strdup(&splitpoint[1]);
+		tmp = &splitpoint[1];
+		
+		/* The last name may be followed by a comma and additional data.
+		 * Only use the last name itself.
+		 */
+		splitpoint = strchr(tmp, ',');
+		if (splitpoint != NULL)
+			default_lastname = g_strndup(tmp, splitpoint - tmp);			
+		else
+			default_lastname = g_strdup(tmp);
 	}
 	else
 	{