diff src/util.c @ 7078:acd2a66e59ed

[gaim-migrate @ 7643] robot101 gave us images in notify_formatted windows. very cool. This lets what I committed earlier (which was support for images in jabber vcards) to work. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Tue, 30 Sep 2003 18:41:28 +0000
parents 9d038cc7e825
children 2343c3aa1dec
line wrap: on
line diff
--- a/src/util.c	Tue Sep 30 18:40:18 2003 +0000
+++ b/src/util.c	Tue Sep 30 18:41:28 2003 +0000
@@ -1003,7 +1003,7 @@
 	gboolean found = FALSE;
 	gboolean in_tag = FALSE;
 	gboolean in_attr = FALSE;
-	gboolean in_quotes = FALSE;
+	char *in_quotes = NULL;
 	size_t needlelen = strlen(needle);
 
 	g_datalist_init(&attribs);
@@ -1013,7 +1013,7 @@
 			if (in_quotes) {
 				const char *close = cur;
 
-				while (*close && *close != '"')
+				while (*close && *close != *in_quotes)
 					close++;
 
 				/* if we got the close quote, store the value and carry on from    *
@@ -1030,7 +1030,7 @@
 						name = NULL;
 					}
 
-					in_quotes = FALSE;
+					in_quotes = NULL;
 					cur = close + 1;
 				} else {
 					cur = close;
@@ -1038,7 +1038,8 @@
 			} else if (in_attr) {
 				const char *close = cur;
 
-				while (*close && *close != '>' && *close != '"' && *close != ' ' && *close != '=')
+				while (*close && *close != '>' && *close != '"' &&
+						*close != '\'' && *close != ' ' && *close != '=')
 					close++;
 
 				/* if we got the equals, store the name of the attribute. if we got
@@ -1047,7 +1048,8 @@
 				 * so we can get outta here */
 				switch (*close) {
 				case '"':
-					in_quotes = TRUE;
+				case '\'':
+					in_quotes = close;
 				case '=':
 					{
 						size_t len = close - cur;
@@ -1082,7 +1084,8 @@
 					*end = cur;
 					break;
 				case '"':
-					in_quotes = TRUE;
+				case '\'':
+					in_quotes = cur;
 				default:
 					cur++;
 					break;