summaryrefslogtreecommitdiff
path: root/usr.bin
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
parent410a200b67425c87e471d3d96a7b588c12a70dc3 (diff)
showenv and setenv need to be CANFAIL.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/cmd-set-environment.c6
-rw-r--r--usr.bin/tmux/cmd-show-environment.c4
2 files changed, 5 insertions, 5 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;
diff --git a/usr.bin/tmux/cmd-show-environment.c b/usr.bin/tmux/cmd-show-environment.c
index e025b8edce3..8103033426e 100644
--- a/usr.bin/tmux/cmd-show-environment.c
+++ b/usr.bin/tmux/cmd-show-environment.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-show-environment.c,v 1.16 2015/12/14 00:31:54 nicm Exp $ */
+/* $OpenBSD: cmd-show-environment.c,v 1.17 2015/12/16 21:47:00 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -94,7 +94,7 @@ cmd_show_environment_exec(struct cmd *self, struct cmd_q *cmdq)
struct environ *env;
struct environ_entry *envent;
- 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;