summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-attach-session.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2017-01-24 20:15:33 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2017-01-24 20:15:33 +0000
commit6feccbfb8530026d713a2a90c60108635fb3abeb (patch)
treeadf1795876b23b248889e990c9c87675a464c0f7 /usr.bin/tmux/cmd-attach-session.c
parent5e3f53613e55106d6b61636be22cede72866d391 (diff)
Make update-environment an array as well.
Diffstat (limited to 'usr.bin/tmux/cmd-attach-session.c')
-rw-r--r--usr.bin/tmux/cmd-attach-session.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/usr.bin/tmux/cmd-attach-session.c b/usr.bin/tmux/cmd-attach-session.c
index 3a6e24a1351..bfa46113402 100644
--- a/usr.bin/tmux/cmd-attach-session.c
+++ b/usr.bin/tmux/cmd-attach-session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-attach-session.c,v 1.65 2016/10/16 22:06:40 nicm Exp $ */
+/* $OpenBSD: cmd-attach-session.c,v 1.66 2017/01/24 20:15:32 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -54,7 +54,6 @@ cmd_attach_session(struct cmdq_item *item, int dflag, int rflag,
struct client *c = item->client, *c_loop;
struct winlink *wl = item->state.tflag.wl;
struct window_pane *wp = item->state.tflag.wp;
- const char *update;
char *cause, *cwd;
struct format_tree *ft;
@@ -95,12 +94,8 @@ cmd_attach_session(struct cmdq_item *item, int dflag, int rflag,
server_client_detach(c_loop, MSG_DETACH);
}
}
-
- if (!Eflag) {
- update = options_get_string(s->options,
- "update-environment");
- environ_update(update, c->environ, s->environ);
- }
+ if (!Eflag)
+ environ_update(s->options, c->environ, s->environ);
c->session = s;
server_client_set_key_table(c, NULL);
@@ -116,7 +111,6 @@ cmd_attach_session(struct cmdq_item *item, int dflag, int rflag,
free(cause);
return (CMD_RETURN_ERROR);
}
-
if (rflag)
c->flags |= CLIENT_READONLY;
@@ -127,12 +121,8 @@ cmd_attach_session(struct cmdq_item *item, int dflag, int rflag,
server_client_detach(c_loop, MSG_DETACH);
}
}
-
- if (!Eflag) {
- update = options_get_string(s->options,
- "update-environment");
- environ_update(update, c->environ, s->environ);
- }
+ if (!Eflag)
+ environ_update(s->options, c->environ, s->environ);
c->session = s;
server_client_set_key_table(c, NULL);