changeset 8921:538a78ff9fdb

[gaim-migrate @ 9691] "MSN fix for sending certain copy-pasted text This basically does that. Send any thext from the paragraphs in http://gaim.sourceforge.net/about.php and you'll see the problem. In msn we can't send multiple font faced formatted text. So this one fixes that." --Felipe Contreras committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Thu, 13 May 2004 12:25:07 +0000
parents 87fcb56feeca
children 9a62b8e3b23b
files src/protocols/msn/utils.c
diffstat 1 files changed, 21 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/msn/utils.c	Wed May 12 03:45:42 2004 +0000
+++ b/src/protocols/msn/utils.c	Thu May 13 12:25:07 2004 +0000
@@ -238,11 +238,15 @@
 				else if (!g_ascii_strncasecmp(c, "face=\"", 6))
 				{
 					const char *end = NULL;
+					const char *comma = NULL;
 					unsigned int namelen = 0;
 
 					c += 6;
 					end = strchr(c, '\"');
-					namelen = (unsigned int)(end - c);
+					comma = strchr(c, ',');
+
+					namelen = (unsigned int)((comma != NULL ? comma : end) - c);
+
 					fontface = g_strndup(c, namelen);
 					c = end + 2;
 				}
@@ -262,21 +266,31 @@
 
 				c++;
 			}
-		} else if (*c == '&') {
-			if (!g_ascii_strncasecmp(c, "&lt;", 4)) {
+		}
+		else if (*c == '&')
+		{
+			if (!g_ascii_strncasecmp(c, "&lt;", 4))
+			{
 				msg[retcount++] = '<';
 				c += 4;
-			} else if (!g_ascii_strncasecmp(c, "&gt;", 4)) {
+			}
+			else if (!g_ascii_strncasecmp(c, "&gt;", 4))
+			{
 				msg[retcount++] = '>';
 				c += 4;
-			} else if (!g_ascii_strncasecmp(c, "&quot;", 6)) {
+			}
+			else if (!g_ascii_strncasecmp(c, "&quot;", 6))
+			{
 				msg[retcount++] = '"';
 				c += 6;
-			} else if (!g_ascii_strncasecmp(c, "&amp;", 5)) {
+			}
+			else if (!g_ascii_strncasecmp(c, "&amp;", 5))
+			{
 				msg[retcount++] = '&';
 				c += 5;
 			}
-		} else
+		}
+		else
 			msg[retcount++] = *c++;
 	}