=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-set-environment.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- src/usr.bin/tmux/cmd-set-environment.c 2012/10/31 19:11:18 1.7 +++ src/usr.bin/tmux/cmd-set-environment.c 2013/03/24 09:54:10 1.8 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-set-environment.c,v 1.7 2012/10/31 19:11:18 okan Exp $ */ +/* $OpenBSD: cmd-set-environment.c,v 1.8 2013/03/24 09:54:10 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -27,7 +27,7 @@ * Set an environment variable. */ -enum cmd_retval cmd_set_environment_exec(struct cmd *, struct cmd_ctx *); +enum cmd_retval cmd_set_environment_exec(struct cmd *, struct cmd_q *); const struct cmd_entry cmd_set_environment_entry = { "set-environment", "setenv", @@ -40,7 +40,7 @@ }; enum cmd_retval -cmd_set_environment_exec(struct cmd *self, struct cmd_ctx *ctx) +cmd_set_environment_exec(struct cmd *self, struct cmd_q *cmdq) { struct args *args = self->args; struct session *s; @@ -49,11 +49,11 @@ name = args->argv[0]; if (*name == '\0') { - ctx->error(ctx, "empty variable name"); + cmdq_error(cmdq, "empty variable name"); return (CMD_RETURN_ERROR); } if (strchr(name, '=') != NULL) { - ctx->error(ctx, "variable name contains ="); + cmdq_error(cmdq, "variable name contains ="); return (CMD_RETURN_ERROR); } @@ -65,26 +65,26 @@ if (args_has(self->args, 'g')) env = &global_environ; else { - if ((s = cmd_find_session(ctx, args_get(args, 't'), 0)) == NULL) + if ((s = cmd_find_session(cmdq, args_get(args, 't'), 0)) == NULL) return (CMD_RETURN_ERROR); env = &s->environ; } if (args_has(self->args, 'u')) { if (value != NULL) { - ctx->error(ctx, "can't specify a value with -u"); + cmdq_error(cmdq, "can't specify a value with -u"); return (CMD_RETURN_ERROR); } environ_unset(env, name); } else if (args_has(self->args, 'r')) { if (value != NULL) { - ctx->error(ctx, "can't specify a value with -r"); + cmdq_error(cmdq, "can't specify a value with -r"); return (CMD_RETURN_ERROR); } environ_set(env, name, NULL); } else { if (value == NULL) { - ctx->error(ctx, "no value specified"); + cmdq_error(cmdq, "no value specified"); return (CMD_RETURN_ERROR); } environ_set(env, name, value);