changeset 7198:78f3252e9d10

[gaim-migrate @ 7767] Error text in the dialog now displays CORRECTLY when logging into MSN with invalid info. My fix the other day was sucky and didn't work. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Wed, 08 Oct 2003 23:27:22 +0000
parents 1f4e74bfe5bc
children aeaa751d32f7
files src/protocols/msn/notification.c
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/msn/notification.c	Wed Oct 08 23:13:08 2003 +0000
+++ b/src/protocols/msn/notification.c	Wed Oct 08 23:27:22 2003 +0000
@@ -424,14 +424,21 @@
 	}
 	else if (strstr(buffer, "HTTP/1.1 401 Unauthorized") != NULL)
 	{
-		const char *error;
+		const char *error, *c;
+		char *temp;
 
 		if ((error = strstr(buffer, "WWW-Authenticate")) != NULL)
 		{
 			if ((error = strstr(error, "cbtxt=")) != NULL)
 			{
 				error += strlen("cbtxt=");
-				error = gaim_url_decode(error);
+
+				if ((c = strchr(error, '\n')) == NULL)
+					c = error + strlen(error);
+
+				temp = g_strndup(error, c - error);
+				error = gaim_url_decode(temp);
+				g_free(temp);
 			}
 		}