summaryrefslogtreecommitdiffstats
path: root/cfg.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2021-02-22 10:01:22 +0000
committerThomas Adam <thomas@xteddy.org>2021-02-22 10:01:22 +0000
commit0cd5ed9e9b56b082e38e7a5be298803ccb68564c (patch)
tree4d8d57ba1f03dd4edfabcb627113456a7e284283 /cfg.c
parentcb7e6698f3241cecfac31a045b907988a4c286f1 (diff)
parent5f425ee31810c964ae5cf1256d0d7fe5dde7536c (diff)
Merge branch 'obsd-master' into master
Diffstat (limited to 'cfg.c')
-rw-r--r--cfg.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/cfg.c b/cfg.c
index 84be3967..3ef46e66 100644
--- a/cfg.c
+++ b/cfg.c
@@ -27,12 +27,15 @@
#include "tmux.h"
struct client *cfg_client;
-static char *cfg_file;
int cfg_finished;
static char **cfg_causes;
static u_int cfg_ncauses;
static struct cmdq_item *cfg_item;
+int cfg_quiet = 1;
+char **cfg_files;
+u_int cfg_nfiles;
+
static enum cmd_retval
cfg_client_done(__unused struct cmdq_item *item, __unused void *data)
{
@@ -60,18 +63,10 @@ cfg_done(__unused struct cmdq_item *item, __unused void *data)
}
void
-set_cfg_file(const char *path)
-{
- free(cfg_file);
- cfg_file = xstrdup(path);
-}
-
-void
start_cfg(void)
{
struct client *c;
- char **paths;
- u_int i, n;
+ u_int i;
/*
* Configuration files are loaded without a client, so commands are run
@@ -89,15 +84,12 @@ start_cfg(void)
cmdq_append(c, cfg_item);
}
- if (cfg_file == NULL) {
- expand_paths(TMUX_CONF, &paths, &n);
- for (i = 0; i < n; i++) {
- load_cfg(paths[i], c, NULL, CMD_PARSE_QUIET, NULL);
- free(paths[i]);
- }
- free(paths);
- } else
- load_cfg(cfg_file, c, NULL, 0, NULL);
+ for (i = 0; i < cfg_nfiles; i++) {
+ if (cfg_quiet)
+ load_cfg(cfg_files[i], c, NULL, CMD_PARSE_QUIET, NULL);
+ else
+ load_cfg(cfg_files[i], c, NULL, 0, NULL);
+ }
cmdq_append(NULL, cmdq_get_callback(cfg_done, NULL));
}