changeset 5177:1c739f2ce94f

[gaim-migrate @ 5541] this will fix gaim's parsing of urls with & in them, when they're sent properly as winaim does, and as gaim does over jabber. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 19 Apr 2003 20:58:50 +0000
parents 6911a84cbab1
children aa3d61f71a91
files src/gtkimhtml.c
diffstat 1 files changed, 24 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkimhtml.c	Sat Apr 19 17:00:40 2003 +0000
+++ b/src/gtkimhtml.c	Sat Apr 19 20:58:50 2003 +0000
@@ -750,6 +750,10 @@
 {
 	gchar *t = tag;
 	gchar *e, *a;
+	gchar *val;
+	gint len;
+	gchar c;
+	GString *ret;
 
 	while (g_ascii_strncasecmp (t, opt, strlen (opt))) {
 		gboolean quote = FALSE;
@@ -773,13 +777,30 @@
 		while (*e && (*e != *(t - 1))) e++;
 		if  (*e == '\0') {
 			return NULL;
-		} else 
-			return g_strndup (a, e - a);
+		} else
+			val = g_strndup(a, e - a);
 	} else {
 		e = a = t;
 		while (*e && !isspace ((gint) *e)) e++;
-		return g_strndup (a, e - a);
+		val = g_strndup(a, e - a);
 	}
+
+	ret = g_string_new("");
+	e = val;
+	while(*e) {
+		if(gtk_imhtml_is_amp_escape(e, &c, &len)) {
+			ret = g_string_append_c(ret, c);
+			e += len;
+		} else {
+			ret = g_string_append_c(ret, *e);
+			e++;
+		}
+	}
+
+	g_free(val);
+	val = ret->str;
+	g_string_free(ret, FALSE);
+	return val;
 }