summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDodji Seketeli <dodji@gnome.org>2004-01-16 20:32:25 +0000
committerDodji Seketeli <dodji@src.gnome.org>2004-01-16 20:32:25 +0000
commita97a943a32d37e1c92aa93e861a28d96f84f2163 (patch)
tree271a54d781b220a860b9f31b8d03f067cf5f1908
parentdcb6882ea77241bf90dfa4a3e40aa440c8a6e554 (diff)
downloadlibcroco-a97a943a32d37e1c92aa93e861a28d96f84f2163.tar.gz
applied a patch from Rob BUIS to fix the rwlbuis@xs4all.nl class selector
2004-01-16 Dodji Seketeli <dodji@gnome.org> * src/seleng/cr-sel-eng.c: applied a patch from Rob BUIS to fix the rwlbuis@xs4all.nl class selector evaluation.
-rw-r--r--ChangeLog6
-rw-r--r--src/seleng/cr-sel-eng.c25
2 files changed, 23 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 5dc6816..5fd876e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-01-16 Dodji Seketeli <dodji@gnome.org>
+
+ * src/seleng/cr-sel-eng.c: applied a patch from
+ Rob BUIS to fix the rwlbuis@xs4all.nl class selector
+ evaluation.
+
2004-01-04 Dodji Seketeli <dodji@gnome.org>
* src/parser/cr-declaration.c:
diff --git a/src/seleng/cr-sel-eng.c b/src/seleng/cr-sel-eng.c
index 122d8ae..edec6b3 100644
--- a/src/seleng/cr-sel-eng.c
+++ b/src/seleng/cr-sel-eng.c
@@ -166,7 +166,7 @@ class_add_sel_matches_node (CRAdditionalSel *a_add_sel,
xmlNode *a_node)
{
gboolean result = FALSE ;
- xmlChar *class = NULL ;
+ xmlChar *klass = NULL, *cur = NULL ;
g_return_val_if_fail (a_add_sel
&& a_add_sel->type == CLASS_ADD_SELECTOR
@@ -176,18 +176,27 @@ class_add_sel_matches_node (CRAdditionalSel *a_add_sel,
if (xmlHasProp (a_node, "class"))
{
- class = xmlGetProp (a_node, "class") ;
- if (!strncmp (class, a_add_sel->content.class_name->str,
- a_add_sel->content.class_name->len))
+ klass = xmlGetProp (a_node, "class") ;
+ for (cur = klass ; *cur ; cur++)
{
- result = TRUE ;
+ while (cr_utils_is_white_space (*cur) == TRUE && *cur)
+ cur ++ ;
+ if (!*cur)
+ break ;
+ if (!strncmp (cur, a_add_sel->content.class_name->str,
+ a_add_sel->content.class_name->len))
+ {
+ cur += a_add_sel->content.class_name->len;
+ if (!*cur || cr_utils_is_white_space (*cur) == TRUE)
+ result = TRUE ;
+ }
}
}
- if (class)
+ if (klass)
{
- xmlFree (class) ;
- class = NULL ;
+ xmlFree (klass) ;
+ klass = NULL ;
}
return result ;