summaryrefslogtreecommitdiff
path: root/openbox/keytree.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbox/keytree.c')
-rw-r--r--openbox/keytree.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/openbox/keytree.c b/openbox/keytree.c
index b26a4da7..202dd32c 100644
--- a/openbox/keytree.c
+++ b/openbox/keytree.c
@@ -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;