summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-split-window.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/cmd-split-window.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/cmd-split-window.c')
-rw-r--r--usr.bin/tmux/cmd-split-window.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/usr.bin/tmux/cmd-split-window.c b/usr.bin/tmux/cmd-split-window.c
index 9fc55df1f26..45b6d81b8f8 100644
--- a/usr.bin/tmux/cmd-split-window.c
+++ b/usr.bin/tmux/cmd-split-window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-split-window.c,v 1.59 2015/10/27 15:58:42 nicm Exp $ */
+/* $OpenBSD: cmd-split-window.c,v 1.60 2015/10/28 09:51:55 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -52,7 +52,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;
@@ -67,10 +67,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");
@@ -151,13 +151,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;
@@ -170,7 +170,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)
@@ -193,7 +193,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);