summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/session.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2015-10-28 09:51:55 +0000
committernicm <nicm@openbsd.org>2015-10-28 09:51:55 +0000
commitfb46cb3d45f8409388c0708ceae7c35b9816d7d2 (patch)
tree82a82e31962a2960a835e9e60a7a64ffff21728f /usr.bin/tmux/session.c
parentkern.cptime is length 2 (diff)
downloadwireguard-openbsd-fb46cb3d45f8409388c0708ceae7c35b9816d7d2.tar.xz
wireguard-openbsd-fb46cb3d45f8409388c0708ceae7c35b9816d7d2.zip
Like options, move the environ struct into environ.c.
Diffstat (limited to 'usr.bin/tmux/session.c')
-rw-r--r--usr.bin/tmux/session.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/usr.bin/tmux/session.c b/usr.bin/tmux/session.c
index 9df9075f83d..822f2dbaa5e 100644
--- a/usr.bin/tmux/session.c
+++ b/usr.bin/tmux/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.56 2015/10/27 15:58:42 nicm Exp $ */
+/* $OpenBSD: session.c,v 1.57 2015/10/28 09:51:55 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -120,9 +120,9 @@ session_create(const char *name, int argc, char **argv, const char *path,
TAILQ_INIT(&s->lastw);
RB_INIT(&s->windows);
- environ_init(&s->environ);
+ s->environ = environ_create();
if (env != NULL)
- environ_copy(env, &s->environ);
+ environ_copy(env, s->environ);
s->options = options_create(global_s_options);
s->tio = NULL;
@@ -190,7 +190,7 @@ session_free(unused int fd, unused short events, void *arg)
log_debug("session %s freed (%d references)", s->name, s->references);
if (s->references == 0) {
- environ_free(&s->environ);
+ environ_free(s->environ);
options_free(s->options);
free(s->name);
@@ -319,7 +319,7 @@ session_new(struct session *s, const char *name, int argc, char **argv,
{
struct window *w;
struct winlink *wl;
- struct environ env;
+ struct environ *env;
const char *shell;
u_int hlimit;
@@ -328,26 +328,26 @@ session_new(struct session *s, const char *name, int argc, char **argv,
return (NULL);
}
- environ_init(&env);
- environ_copy(&global_environ, &env);
- environ_copy(&s->environ, &env);
- server_fill_environ(s, &env);
+ env = environ_create();
+ environ_copy(global_environ, env);
+ environ_copy(s->environ, env);
+ server_fill_environ(s, env);
shell = options_get_string(s->options, "default-shell");
if (*shell == '\0' || areshell(shell))
shell = _PATH_BSHELL;
hlimit = options_get_number(s->options, "history-limit");
- w = window_create(name, argc, argv, path, shell, cwd, &env, s->tio,
+ w = window_create(name, argc, argv, path, shell, cwd, env, s->tio,
s->sx, s->sy, hlimit, cause);
if (w == NULL) {
winlink_remove(&s->windows, wl);
- environ_free(&env);
+ environ_free(env);
return (NULL);
}
winlink_set_window(wl, w);
notify_window_linked(s, w);
- environ_free(&env);
+ environ_free(env);
if (options_get_number(s->options, "set-remain-on-exit"))
options_set_number(w->options, "remain-on-exit", 1);