summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-respawn-pane.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2015-10-28 09:51:56 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2015-10-28 09:51:56 +0000
commit40292bea5af2e23c6bb1c93a31f83cbe49759bd2 (patch)
treea194b8cd92e6aa597a927b77a6bb9827b12d8e05 /usr.bin/tmux/cmd-respawn-pane.c
parent56b0f7fb77db41cfb361986b6cb66954d779c413 (diff)
Like options, move the environ struct into environ.c.
Diffstat (limited to 'usr.bin/tmux/cmd-respawn-pane.c')
-rw-r--r--usr.bin/tmux/cmd-respawn-pane.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/usr.bin/tmux/cmd-respawn-pane.c b/usr.bin/tmux/cmd-respawn-pane.c
index 29d96e51a75..365cf2a6e8b 100644
--- a/usr.bin/tmux/cmd-respawn-pane.c
+++ b/usr.bin/tmux/cmd-respawn-pane.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-respawn-pane.c,v 1.14 2015/03/31 17:45:10 nicm Exp $ */
+/* $OpenBSD: cmd-respawn-pane.c,v 1.15 2015/10/28 09:51:55 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -46,7 +46,7 @@ cmd_respawn_pane_exec(struct cmd *self, struct cmd_q *cmdq)
struct window *w;
struct window_pane *wp;
struct session *s;
- struct environ env;
+ struct environ *env;
const char *path;
char *cause;
u_int idx;
@@ -64,10 +64,10 @@ cmd_respawn_pane_exec(struct cmd *self, struct cmd_q *cmdq)
return (CMD_RETURN_ERROR);
}
- 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);
window_pane_reset_mode(wp);
screen_reinit(&wp->base);
@@ -75,22 +75,22 @@ cmd_respawn_pane_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(wp, args->argc, args->argv, path, NULL, -1, &env,
+ if (window_pane_spawn(wp, args->argc, args->argv, path, NULL, -1, env,
s->tio, &cause) != 0) {
cmdq_error(cmdq, "respawn pane failed: %s", cause);
free(cause);
- environ_free(&env);
+ environ_free(env);
return (CMD_RETURN_ERROR);
}
wp->flags |= PANE_REDRAW;
server_status_window(w);
- environ_free(&env);
+ environ_free(env);
return (CMD_RETURN_NORMAL);
}