]> Dogcows Code - chaz/openbox/blobdiff - parser/parse.c
add --debug-focus
[chaz/openbox] / parser / parse.c
index 33f80546c7c625113048037fb00571fb4ecf3117..552221caf9e5128043253336faecc6442f3f59d1 100644 (file)
@@ -79,16 +79,27 @@ void parse_register(ObParseInst *i, const gchar *tag,
     g_hash_table_insert(i->callbacks, c->tag, c);
 }
 
-gboolean parse_load_rc(xmlDocPtr *doc, xmlNodePtr *root)
+gboolean parse_load_rc(const gchar *file, xmlDocPtr *doc, xmlNodePtr *root,
+                       gchar **fileused)
 {
     GSList *it;
-    gchar *path;
     gboolean r = FALSE;
 
+    *fileused = NULL;
+
     for (it = xdg_config_dir_paths; !r && it; it = g_slist_next(it)) {
-        path = g_build_filename(it->data, "openbox", "rc.xml", NULL);
-        r = parse_load(path, "openbox_config", doc, root);
-        g_free(path);
+        if (file) {
+            if ((r = parse_load(file, "openbox_config", doc, root)))
+                *fileused = g_strdup(file);
+        } else {
+            gchar *path;
+
+            path = g_build_filename(it->data, "openbox", "rc.xml", NULL);
+            if ((r = parse_load(path, "openbox_config", doc, root)))
+                *fileused = path;
+            else
+                g_free(path);
+        }
     }
     if (!r)
         g_warning("Unable to find a valid config file, using defaults");
This page took 0.020761 seconds and 4 git commands to generate.