summaryrefslogtreecommitdiffstats
path: root/cmd-set-environment.c
diff options
context:
space:
mode:
authornicm <nicm>2020-04-13 08:26:27 +0000
committernicm <nicm>2020-04-13 08:26:27 +0000
commitc20eb0c0ae3347c768894a6355adfd7ebae6f2f3 (patch)
tree970e82f29bd603d459476d44245ce73aad18666e /cmd-set-environment.c
parent9cbe9675ea8a8efb01dcc5f267e6d5853b2cd58f (diff)
Make struct cmd local to cmd.c and move it out of tmux.h.
Diffstat (limited to 'cmd-set-environment.c')
-rw-r--r--cmd-set-environment.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd-set-environment.c b/cmd-set-environment.c
index 248f734a..72e40ded 100644
--- a/cmd-set-environment.c
+++ b/cmd-set-environment.c
@@ -46,7 +46,7 @@ const struct cmd_entry cmd_set_environment_entry = {
static enum cmd_retval
cmd_set_environment_exec(struct cmd *self, struct cmdq_item *item)
{
- struct args *args = self->args;
+ struct args *args = cmd_get_args(self);
struct environ *env;
const char *name, *value, *target;
@@ -65,7 +65,7 @@ cmd_set_environment_exec(struct cmd *self, struct cmdq_item *item)
else
value = args->argv[1];
- if (args_has(self->args, 'g'))
+ if (args_has(args, 'g'))
env = global_environ;
else {
if (item->target.s == NULL) {
@@ -79,13 +79,13 @@ cmd_set_environment_exec(struct cmd *self, struct cmdq_item *item)
env = item->target.s->environ;
}
- if (args_has(self->args, 'u')) {
+ if (args_has(args, 'u')) {
if (value != NULL) {
cmdq_error(item, "can't specify a value with -u");
return (CMD_RETURN_ERROR);
}
environ_unset(env, name);
- } else if (args_has(self->args, 'r')) {
+ } else if (args_has(args, 'r')) {
if (value != NULL) {
cmdq_error(item, "can't specify a value with -r");
return (CMD_RETURN_ERROR);