summaryrefslogtreecommitdiffstats
path: root/session.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2015-10-28 12:01:11 +0000
committerThomas Adam <thomas@xteddy.org>2015-10-28 12:01:11 +0000
commita5e4d3a2d8c2fb288488ee5922a561a4a9e6803a (patch)
treeebfcd8a38514651c4657dac40601a5aafa360b89 /session.c
parentda1f6fc2c8477c99e986061bcdd7c3e854a60076 (diff)
parentbf9c933caed5c74be3c9c4da02d7c57a9dcf091d (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'session.c')
-rw-r--r--session.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/session.c b/session.c
index 50af8a04..9f086bbd 100644
--- a/session.c
+++ b/session.c
@@ -119,9 +119,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;
@@ -189,7 +189,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);
@@ -318,7 +318,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;
@@ -327,26 +327,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);