Bump to 3.4.11.2 and update changelog
[mikachu/openbox.git] / parser / parse.c
index dd05069..6db7ca7 100644 (file)
@@ -219,10 +219,12 @@ void parse_close(xmlDocPtr doc)
 void parse_tree(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
 {
     while (node) {
-        struct Callback *c = g_hash_table_lookup(i->callbacks, node->name);
+        if (node->name) {
+            struct Callback *c = g_hash_table_lookup(i->callbacks, node->name);
 
-        if (c)
-            c->func(i, doc, node, c->data);
+            if (c)
+                c->func(i, doc, node, c->data);
+        }
 
         node = node->next;
     }
@@ -473,7 +475,8 @@ gchar *parse_expand_tilde(const gchar *f)
     if (!f)
         return NULL;
 
-    regex = g_regex_new("(?:^|(?<=[ \\t]))~(?=[/ \\t$])", G_REGEX_MULTILINE | G_REGEX_RAW, 0, NULL);
+    regex = g_regex_new("(?:^|(?<=[ \\t]))~(?:(?=[/ \\t])|$)",
+                        G_REGEX_MULTILINE | G_REGEX_RAW, 0, NULL);
     ret = g_regex_replace_literal(regex, f, -1, 0, g_get_home_dir(), 0, NULL);
     g_regex_unref(regex);