version 1.5, 2013/03/21 16:09:17 |
version 1.6, 2013/03/21 16:09:59 |
|
|
cmd_choose_list_exec(struct cmd *self, struct cmd_ctx *ctx) |
cmd_choose_list_exec(struct cmd *self, struct cmd_ctx *ctx) |
{ |
{ |
struct args *args = self->args; |
struct args *args = self->args; |
|
struct client *c; |
struct winlink *wl; |
struct winlink *wl; |
const char *list1; |
const char *list1; |
char *template, *item, *copy, *list; |
char *template, *item, *copy, *list; |
u_int idx; |
u_int idx; |
|
|
if (ctx->curclient == NULL) { |
if ((c = cmd_current_client(ctx)) == NULL) { |
ctx->error(ctx, "must be run interactively"); |
ctx->error(ctx, "no client available"); |
return (CMD_RETURN_ERROR); |
return (CMD_RETURN_ERROR); |
} |
} |
|
|
|
|
{ |
{ |
if (*item == '\0') /* no empty entries */ |
if (*item == '\0') /* no empty entries */ |
continue; |
continue; |
window_choose_add_item(wl->window->active, ctx, wl, item, |
window_choose_add_item(wl->window->active, c, wl, item, |
template, idx); |
template, idx); |
idx++; |
idx++; |
} |
} |