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;
}
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);