=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-show-environment.c,v retrieving revision 1.5 retrieving revision 1.6 diff -c -r1.5 -r1.6 *** src/usr.bin/tmux/cmd-show-environment.c 2012/03/22 11:11:57 1.5 --- src/usr.bin/tmux/cmd-show-environment.c 2012/07/11 07:10:15 1.6 *************** *** 1,4 **** ! /* $OpenBSD: cmd-show-environment.c,v 1.5 2012/03/22 11:11:57 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-show-environment.c,v 1.6 2012/07/11 07:10:15 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott *************** *** 27,33 **** * Show environment. */ ! int cmd_show_environment_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_show_environment_entry = { "show-environment", "showenv", --- 27,33 ---- * Show environment. */ ! enum cmd_retval cmd_show_environment_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_show_environment_entry = { "show-environment", "showenv", *************** *** 39,45 **** cmd_show_environment_exec }; ! int cmd_show_environment_exec(struct cmd *self, struct cmd_ctx *ctx) { struct args *args = self->args; --- 39,45 ---- cmd_show_environment_exec }; ! enum cmd_retval cmd_show_environment_exec(struct cmd *self, struct cmd_ctx *ctx) { struct args *args = self->args; *************** *** 51,57 **** env = &global_environ; else { if ((s = cmd_find_session(ctx, args_get(args, 't'), 0)) == NULL) ! return (-1); env = &s->environ; } --- 51,57 ---- env = &global_environ; else { if ((s = cmd_find_session(ctx, args_get(args, 't'), 0)) == NULL) ! return (CMD_RETURN_ERROR); env = &s->environ; } *************** *** 59,71 **** envent = environ_find(env, args->argv[0]); if (envent == NULL) { ctx->error(ctx, "unknown variable: %s", args->argv[0]); ! return (-1); } if (envent->value != NULL) ctx->print(ctx, "%s=%s", envent->name, envent->value); else ctx->print(ctx, "-%s", envent->name); ! return (0); } RB_FOREACH(envent, environ, env) { --- 59,71 ---- envent = environ_find(env, args->argv[0]); if (envent == NULL) { ctx->error(ctx, "unknown variable: %s", args->argv[0]); ! return (CMD_RETURN_ERROR); } if (envent->value != NULL) ctx->print(ctx, "%s=%s", envent->name, envent->value); else ctx->print(ctx, "-%s", envent->name); ! return (CMD_RETURN_NORMAL); } RB_FOREACH(envent, environ, env) { *************** *** 75,79 **** ctx->print(ctx, "-%s", envent->name); } ! return (0); } --- 75,79 ---- ctx->print(ctx, "-%s", envent->name); } ! return (CMD_RETURN_NORMAL); }