summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/tmux.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-02-22 11:42:51 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-02-22 11:42:51 +0000
commitd319892875e2f83b01a1465aa6eba7a928f9b9da (patch)
tree372eeb115e206b6ac926f73c52dea6ba48331dc0 /usr.bin/tmux/tmux.c
parentcb41bc21f6ba312150cc5b8cddcd5a334c833a10 (diff)
expand_paths needs the global environment to be set up, do that first.
Diffstat (limited to 'usr.bin/tmux/tmux.c')
-rw-r--r--usr.bin/tmux/tmux.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/tmux/tmux.c b/usr.bin/tmux/tmux.c
index 91c0e5dbd88..82cb97f0c1d 100644
--- a/usr.bin/tmux/tmux.c
+++ b/usr.bin/tmux/tmux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.c,v 1.205 2021/02/22 08:18:13 nicm Exp $ */
+/* $OpenBSD: tmux.c,v 1.206 2021/02/22 11:42:50 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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);