summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-set-environment.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2015-12-16 21:47:01 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2015-12-16 21:47:01 +0000
commitbf3319dd4e4b364a7924e99c72e83dbdb76df2db (patch)
treee8b659c72dfc0652a52fc0a0cb9d240c6fdec75a /usr.bin/tmux/cmd-set-environment.c
parent410a200b67425c87e471d3d96a7b588c12a70dc3 (diff)
showenv and setenv need to be CANFAIL.
Diffstat (limited to 'usr.bin/tmux/cmd-set-environment.c')
-rw-r--r--usr.bin/tmux/cmd-set-environment.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-set-environment.c b/usr.bin/tmux/cmd-set-environment.c
index ec2aca41abf..ddd9d1fe0f6 100644
--- a/usr.bin/tmux/cmd-set-environment.c
+++ b/usr.bin/tmux/cmd-set-environment.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-set-environment.c,v 1.15 2015/12/14 00:31:54 nicm Exp $ */
+/* $OpenBSD: cmd-set-environment.c,v 1.16 2015/12/16 21:47:00 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -36,7 +36,7 @@ const struct cmd_entry cmd_set_environment_entry = {
.args = { "grt:u", 1, 2 },
.usage = "[-gru] " CMD_TARGET_SESSION_USAGE " name [value]",
- .tflag = CMD_SESSION,
+ .tflag = CMD_SESSION_CANFAIL,
.flags = 0,
.exec = cmd_set_environment_exec
@@ -64,7 +64,7 @@ cmd_set_environment_exec(struct cmd *self, struct cmd_q *cmdq)
else
value = args->argv[1];
- if (args_has(self->args, 'g'))
+ if (args_has(self->args, 'g') || cmdq->state.tflag.s == NULL)
env = global_environ;
else
env = cmdq->state.tflag.s->environ;