diff options
author | Thomas Adam <thomas@xteddy.org> | 2015-10-28 12:01:11 +0000 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2015-10-28 12:01:11 +0000 |
commit | a5e4d3a2d8c2fb288488ee5922a561a4a9e6803a (patch) | |
tree | ebfcd8a38514651c4657dac40601a5aafa360b89 /cmd-split-window.c | |
parent | da1f6fc2c8477c99e986061bcdd7c3e854a60076 (diff) | |
parent | bf9c933caed5c74be3c9c4da02d7c57a9dcf091d (diff) |
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-split-window.c')
-rw-r--r-- | cmd-split-window.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/cmd-split-window.c b/cmd-split-window.c index 026f951f..ec37e0d7 100644 --- a/cmd-split-window.c +++ b/cmd-split-window.c @@ -51,7 +51,7 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq) struct winlink *wl; struct window *w; struct window_pane *wp, *new_wp = NULL; - struct environ env; + struct environ *env; const char *cmd, *path, *shell, *template; char **argv, *cause, *new_cause, *cp; u_int hlimit; @@ -66,10 +66,10 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq) w = wl->window; server_unzoom_window(w); - 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); if (args->argc == 0) { cmd = options_get_string(s->options, "default-command"); @@ -150,13 +150,13 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq) path = NULL; if (cmdq->client != NULL && cmdq->client->session == NULL) - envent = environ_find(&cmdq->client->environ, "PATH"); + envent = environ_find(cmdq->client->environ, "PATH"); else - envent = environ_find(&s->environ, "PATH"); + envent = environ_find(s->environ, "PATH"); if (envent != NULL) path = envent->value; - if (window_pane_spawn(new_wp, argc, argv, path, shell, cwd, &env, + if (window_pane_spawn(new_wp, argc, argv, path, shell, cwd, env, s->tio, &cause) != 0) goto error; @@ -169,7 +169,7 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq) } else server_status_session(s); - environ_free(&env); + environ_free(env); if (args_has(args, 'P')) { if ((template = args_get(args, 'F')) == NULL) @@ -192,7 +192,7 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq) return (CMD_RETURN_NORMAL); error: - environ_free(&env); + environ_free(env); if (new_wp != NULL) { layout_close_pane(new_wp); window_remove_pane(w, new_wp); |