]> git.sur5r.net Git - i3/i3/commitdiff
Reload the same config file specified in the command line.
authorFernando Tarlá Cardoso Lemos <fernandotcl@gmail.com>
Sun, 13 Mar 2011 23:32:54 +0000 (20:32 -0300)
committerMichael Stapelberg <michael@stapelberg.de>
Mon, 14 Mar 2011 15:48:45 +0000 (16:48 +0100)
Fixes: #346
src/config.c

index e7f4617b26911dbc1a91fe38af8d8c68d11d2628..80071d212f1cfea9fe125810bbb128bf6c736165 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * vim:ts=8:expandtab
+ * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
  *
@@ -232,15 +232,22 @@ static char *get_config_path() {
  *
  */
 static void parse_configuration(const char *override_configpath) {
-        if (override_configpath != NULL) {
-                parse_file(override_configpath);
-                return;
-        }
-
-        char *path = get_config_path();
-        DLOG("Parsing configfile %s\n", path);
-        parse_file(path);
-        free(path);
+    static const char *saved_configpath = NULL;
+
+    if (override_configpath != NULL) {
+        saved_configpath = override_configpath;
+        parse_file(override_configpath);
+        return;
+    }
+    else if (saved_configpath != NULL) {
+        parse_file(saved_configpath);
+        return;
+    }
+
+    char *path = get_config_path();
+    DLOG("Parsing configfile %s\n", path);
+    parse_file(path);
+    free(path);
 }
 
 /*