[gtk+/gtk-style-context: 332/347] GtkCssProvider: Do not miss the last class name in concatenated classes.



commit d261a3c389f8d418a7cf35d6ba6c7b753626088e
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Nov 8 02:51:53 2010 +0100

    GtkCssProvider: Do not miss the last class name in concatenated classes.
    
    Selectors like .menu.check or .entry.progressbar were being misparsed
    and attributed to .menu and .entry.

 gtk/gtkcssprovider.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 977db0d..cad20c0 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -1363,6 +1363,7 @@ parse_classes (SelectorPath   *path,
 
   if ((pos = strchr (str, '.')) != NULL)
     {
+      /* Leave the last class to the call after the loop */
       while (pos)
         {
           *pos = '\0';
@@ -1372,8 +1373,8 @@ parse_classes (SelectorPath   *path,
           pos = strchr (str, '.');
         }
     }
-  else
-    selector_path_prepend_class (path, str);
+
+  selector_path_prepend_class (path, str);
 }
 
 static GTokenType



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]