diff options
author | Tiago Cunha <tcunha@gmx.com> | 2012-07-11 19:37:32 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2012-07-11 19:37:32 +0000 |
commit | 1f5e6e35d5046693f0ef5ec76535f517757b7122 (patch) | |
tree | e53808c90f3a53279554f8580d2b96df606baec3 /cmd-find-window.c | |
parent | a432fcd30617610b46d65f49b7513bf5da5694de (diff) | |
download | rtmux-1f5e6e35d5046693f0ef5ec76535f517757b7122.tar.gz rtmux-1f5e6e35d5046693f0ef5ec76535f517757b7122.tar.bz2 rtmux-1f5e6e35d5046693f0ef5ec76535f517757b7122.zip |
Sync OpenBSD patchset 1151:
Make command exec functions return an enum rather than -1/0/1 values and
add a new value to mean "leave client running but don't attach" to fix
problems with using some commands in a command sequence. Most of the
work by Thomas Adam, problem reported by "jspenguin" on SF bug 3535531.
Diffstat (limited to 'cmd-find-window.c')
-rw-r--r-- | cmd-find-window.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cmd-find-window.c b/cmd-find-window.c index 33187068..b51475bd 100644 --- a/cmd-find-window.c +++ b/cmd-find-window.c @@ -28,7 +28,7 @@ * Find window containing text. */ -int cmd_find_window_exec(struct cmd *, struct cmd_ctx *); +enum cmd_retval cmd_find_window_exec(struct cmd *, struct cmd_ctx *); u_int cmd_find_window_match_flags(struct args *); void cmd_find_window_callback(struct window_choose_data *); @@ -74,7 +74,7 @@ cmd_find_window_match_flags(struct args *args) return (match_flags); } -int +enum cmd_retval cmd_find_window_exec(struct cmd *self, struct cmd_ctx *ctx) { struct args *args = self->args; @@ -90,12 +90,12 @@ cmd_find_window_exec(struct cmd *self, struct cmd_ctx *ctx) if (ctx->curclient == NULL) { ctx->error(ctx, "must be run interactively"); - return (-1); + return (CMD_RETURN_ERROR); } s = ctx->curclient->session; if ((wl = cmd_find_window(ctx, args_get(args, 't'), NULL)) == NULL) - return (-1); + return (CMD_RETURN_ERROR); if ((template = args_get(args, 'F')) == NULL) template = DEFAULT_FIND_WINDOW_TEMPLATE; @@ -150,7 +150,7 @@ cmd_find_window_exec(struct cmd *self, struct cmd_ctx *ctx) ctx->error(ctx, "no windows matching: %s", str); ARRAY_FREE(&list_idx); ARRAY_FREE(&list_ctx); - return (-1); + return (CMD_RETURN_ERROR); } if (ARRAY_LENGTH(&list_idx) == 1) { @@ -189,7 +189,7 @@ out: ARRAY_FREE(&list_idx); ARRAY_FREE(&list_ctx); - return (0); + return (CMD_RETURN_NORMAL); } void |