diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-09-05 10:14:22 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-09-05 10:14:22 +0000 |
commit | e12ba72be62c4fcf3878a0e29f4a3ce81accbfbf (patch) | |
tree | 71dad67f43285dfb91d6b6ce9800a214c4851733 /usr.bin | |
parent | aeb45f7a46435268071df4d813b20c62074738a4 (diff) |
Handle empty list properly in choose-list, based on fix from Thomas Adam.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/cmd-choose-list.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/tmux/cmd-choose-list.c b/usr.bin/tmux/cmd-choose-list.c index 4b71e532143..febbd0e41b1 100644 --- a/usr.bin/tmux/cmd-choose-list.c +++ b/usr.bin/tmux/cmd-choose-list.c @@ -1,4 +1,4 @@ -/* $Id: cmd-choose-list.c,v 1.2 2012/09/03 10:02:39 nicm Exp $ */ +/* $Id: cmd-choose-list.c,v 1.3 2012/09/05 10:14:21 nicm Exp $ */ /* * Copyright (c) 2012 Thomas Adam <thomas@xteddy.org> @@ -86,6 +86,12 @@ cmd_choose_list_exec(struct cmd *self, struct cmd_ctx *ctx) } free(copy); + if (idx == 0) { + free(template); + window_pane_reset_mode(wl->window->active); + return (CMD_RETURN_ERROR); + } + window_choose_ready(wl->window->active, 0, cmd_choose_list_callback, cmd_choose_list_free); |