=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-new-window.c,v retrieving revision 1.25 retrieving revision 1.26 diff -c -r1.25 -r1.26 *** src/usr.bin/tmux/cmd-new-window.c 2012/07/10 11:53:01 1.25 --- src/usr.bin/tmux/cmd-new-window.c 2012/07/11 07:10:15 1.26 *************** *** 1,4 **** ! /* $OpenBSD: cmd-new-window.c,v 1.25 2012/07/10 11:53:01 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-new-window.c,v 1.26 2012/07/11 07:10:15 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 39,45 **** cmd_new_window_exec }; ! int cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx) { struct args *args = self->args; --- 39,45 ---- cmd_new_window_exec }; ! enum cmd_retval cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx) { struct args *args = self->args; *************** *** 56,62 **** if (args_has(args, 'a')) { wl = cmd_find_window(ctx, args_get(args, 't'), &s); if (wl == NULL) ! return (-1); idx = wl->idx + 1; /* Find the next free index. */ --- 56,62 ---- if (args_has(args, 'a')) { wl = cmd_find_window(ctx, args_get(args, 't'), &s); if (wl == NULL) ! return (CMD_RETURN_ERROR); idx = wl->idx + 1; /* Find the next free index. */ *************** *** 66,72 **** } if (last == INT_MAX) { ctx->error(ctx, "no free window indexes"); ! return (-1); } /* Move everything from last - 1 to idx up a bit. */ --- 66,72 ---- } if (last == INT_MAX) { ctx->error(ctx, "no free window indexes"); ! return (CMD_RETURN_ERROR); } /* Move everything from last - 1 to idx up a bit. */ *************** *** 77,83 **** } } else { if ((idx = cmd_find_index(ctx, args_get(args, 't'), &s)) == -2) ! return (-1); } detached = args_has(args, 'd'); --- 77,83 ---- } } else { if ((idx = cmd_find_index(ctx, args_get(args, 't'), &s)) == -2) ! return (CMD_RETURN_ERROR); } detached = args_has(args, 'd'); *************** *** 113,119 **** if (wl == NULL) { ctx->error(ctx, "create window failed: %s", cause); free(cause); ! return (-1); } if (!detached) { session_select(s, wl->idx); --- 113,119 ---- if (wl == NULL) { ctx->error(ctx, "create window failed: %s", cause); free(cause); ! return (CMD_RETURN_ERROR); } if (!detached) { session_select(s, wl->idx); *************** *** 139,143 **** format_free(ft); } ! return (0); } --- 139,143 ---- format_free(ft); } ! return (CMD_RETURN_NORMAL); }