summaryrefslogtreecommitdiffstats
path: root/tmux.c
diff options
context:
space:
mode:
authornicm <nicm>2021-02-22 11:42:50 +0000
committernicm <nicm>2021-02-22 11:42:50 +0000
commit6d8efe9319857c0b1bc49118248efe7f55112bb5 (patch)
treeb1355b7d1c6641ee935f3a2a7701675d25af627e /tmux.c
parent5f425ee31810c964ae5cf1256d0d7fe5dde7536c (diff)
expand_paths needs the global environment to be set up, do that first.
Diffstat (limited to 'tmux.c')
-rw-r--r--tmux.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tmux.c b/tmux.c
index fb908031..71cbccba 100644
--- a/tmux.c
+++ b/tmux.c
@@ -357,6 +357,12 @@ main(int argc, char **argv)
if (**argv == '-')
flags = CLIENT_LOGIN;
+
+ global_environ = environ_create();
+ for (var = environ; *var != NULL; var++)
+ environ_put(global_environ, *var, 0);
+ if ((cwd = find_cwd()) != NULL)
+ environ_set(global_environ, "PWD", 0, "%s", cwd);
expand_paths(TMUX_CONF, &cfg_files, &cfg_nfiles, 1);
while ((opt = getopt(argc, argv, "2c:CDdf:lL:NqS:T:uUvV")) != -1) {
@@ -451,12 +457,6 @@ main(int argc, char **argv)
flags |= CLIENT_UTF8;
}
- global_environ = environ_create();
- for (var = environ; *var != NULL; var++)
- environ_put(global_environ, *var, 0);
- if ((cwd = find_cwd()) != NULL)
- environ_set(global_environ, "PWD", 0, "%s", cwd);
-
global_options = options_create(NULL);
global_s_options = options_create(NULL);
global_w_options = options_create(NULL);