]> Dogcows Code - chaz/openbox/blobdiff - openbox/keytree.c
fixes for new keybindings stuff/chroot/parsing
[chaz/openbox] / openbox / keytree.c
index b26a4da7dac41cbe6e295cd9b915374f1137cb69..202dd32c9864e55c1623c7b04852bbcead34e871 100644 (file)
@@ -133,16 +133,16 @@ KeyBindingTree *tree_find(KeyBindingTree *search, gboolean *conflict)
 
 gboolean tree_chroot(KeyBindingTree *tree, GList *keylist)
 {
-    if (keylist == NULL) {
-        tree->chroot = TRUE;
-        return TRUE;
-    } else {
-        guint key, state;
-        if (translate_key(keylist->data, &state, &key)) {
-            while (tree != NULL && !(tree->state == state && tree->key == key))
-                tree = tree->next_sibling;
-            if (tree != NULL)
-                return tree_chroot(tree, keylist->next);
+    guint key, state;
+    if (translate_key(keylist->data, &state, &key)) {
+        while (tree != NULL && !(tree->state == state && tree->key == key))
+            tree = tree->next_sibling;
+        if (tree != NULL) {
+            if (keylist->next == NULL) {
+                tree->chroot = TRUE;
+                return TRUE;
+            } else
+                return tree_chroot(tree->first_child, keylist->next);
         }
     }
     return FALSE;
This page took 0.021472 seconds and 4 git commands to generate.