X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=parser%2Fparse.c;h=fb53f1c5515cc14f4529debab0ae32c42e9097dd;hb=7db7d62ceb5064cd204444669f718397707b11d9;hp=9db02fb067adf3139a1f1722faa54473e098452e;hpb=ec304c9e433e4b1cedf924ca64d783f05db7d42d;p=chaz%2Fopenbox diff --git a/parser/parse.c b/parser/parse.c index 9db02fb0..fb53f1c5 100644 --- a/parser/parse.c +++ b/parser/parse.c @@ -152,7 +152,8 @@ gboolean parse_load(const gchar *path, const gchar *rootname, /* XML_PARSE_BLANKS is needed apparently. When it loads a theme file, without this option, the tree is weird and has extra nodes in it. */ - if ((*doc = xmlReadFile(path, NULL, XML_PARSE_NOBLANKS))) { + if ((*doc = xmlReadFile(path, NULL, + XML_PARSE_NOBLANKS | XML_PARSE_RECOVER))) { *root = xmlDocGetRootElement(*doc); if (!*root) { xmlFreeDoc(*doc); @@ -334,6 +335,8 @@ static GSList* slist_path_add(GSList *list, gpointer data, GSListFunc func) if (!g_slist_find_custom(list, data, (GCompareFunc) slist_path_cmp)) list = func(list, data); + else + g_free(data); return list; } @@ -388,7 +391,7 @@ void parse_paths_startup() (GSListFunc) g_slist_append); } xdg_config_dir_paths = slist_path_add(xdg_config_dir_paths, - xdg_config_home_path, + g_strdup(xdg_config_home_path), (GSListFunc) g_slist_prepend); path = g_getenv("XDG_DATA_DIRS"); @@ -410,7 +413,7 @@ void parse_paths_startup() (GSListFunc) g_slist_append); } xdg_data_dir_paths = slist_path_add(xdg_data_dir_paths, - xdg_data_home_path, + g_strdup(xdg_data_home_path), (GSListFunc) g_slist_prepend); }