]> Dogcows Code - chaz/openbox/commitdiff
only load the system rc if the user rc didnt load
authorDana Jansens <danakj@orodu.net>
Sat, 22 Mar 2003 22:51:27 +0000 (22:51 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 22 Mar 2003 22:51:27 +0000 (22:51 +0000)
openbox/config.c

index 3f3c70c172ec159cb8a9cb0c240175d23928e08e..b9c24dedc147f8f9d9b855096f4c8a00415ee033 100644 (file)
@@ -44,22 +44,26 @@ void config_parse()
 {
     FILE *file;
     char *path;
+    gboolean load = FALSE;
 
-    /* load the system wide rc file first */
-    path = g_build_filename(RCDIR, "rc3", NULL);
+    /* load the user rc */
+    path = g_build_filename(g_get_home_dir(), ".openbox", "rc3", NULL);
     if ((file = fopen(path, "r")) != NULL) {
         cparse_go(path, file);
         fclose(file);
+        load = TRUE;
     }
     g_free(path);
+    g_free(path);
 
-    /* then load the user one which can override it */
-    path = g_build_filename(g_get_home_dir(), ".openbox", "rc3", NULL);
-    if ((file = fopen(path, "r")) != NULL) {
-        cparse_go(path, file);
-        fclose(file);
+    if (!load) {
+        /* load the system wide rc */
+        path = g_build_filename(RCDIR, "rc3", NULL);
+        if ((file = fopen(path, "r")) != NULL) {
+            cparse_go(path, file);
+            fclose(file);
+        }
     }
-    g_free(path);
 }
 
 gboolean config_set(char *name, ConfigValueType type, ConfigValue value)
This page took 0.025001 seconds and 4 git commands to generate.