changeset 8538:848dfa9fe9d4

[gaim-migrate @ 9279] fix the single quote link thing the right way committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Wed, 31 Mar 2004 22:56:09 +0000
parents dc818b62379e
children e0f659e4323e
files src/util.c
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/util.c	Wed Mar 31 18:37:06 2004 +0000
+++ b/src/util.c	Wed Mar 31 22:56:09 2004 +0000
@@ -1150,13 +1150,23 @@
 	const char *c, *t, *q = NULL;
 	char *tmp;
 	char url_buf[BUF_LEN * 4];
+	gboolean inside_html = FALSE;
 	GString *ret = g_string_new("");
 	/* Assumes you have a buffer able to cary at least BUF_LEN * 2 bytes */
 
 	c = text;
 	while (*c) {
-		if(!q && (*c == '\"' || *c == '\'')) {
-			q = c;
+		if(inside_html) {
+			if(*c == '>') {
+				inside_html = FALSE;
+			} else if(!q && (*c == '\"' || *c == '\'')) {
+				q = c;
+			} else if(q) {
+				if(*c == *q)
+					q = NULL;
+			}
+		} else if(*c == '<') {
+			inside_html = TRUE;
 		} else if (!g_ascii_strncasecmp(c, "<A", 2)) {
 			while (1) {
 				if (!g_ascii_strncasecmp(c, "/A>", 3)) {
@@ -1336,9 +1346,6 @@
 
 				t++;
 			}
-		} else if(q) {
-			if(*c == *q)
-				q = NULL;
 		}
 
 		if (*c == 0)