=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-list-windows.c,v retrieving revision 1.39 retrieving revision 1.40 diff -c -r1.39 -r1.40 *** src/usr.bin/tmux/cmd-list-windows.c 2016/10/14 22:14:22 1.39 --- src/usr.bin/tmux/cmd-list-windows.c 2016/10/16 19:04:05 1.40 *************** *** 1,4 **** ! /* $OpenBSD: cmd-list-windows.c,v 1.39 2016/10/14 22:14:22 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-list-windows.c,v 1.40 2016/10/16 19:04:05 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 39,49 **** "(#{window_panes} panes) " \ "[#{window_width}x#{window_height}] " ! static enum cmd_retval cmd_list_windows_exec(struct cmd *, struct cmd_q *); ! static void cmd_list_windows_server(struct cmd *, struct cmd_q *); static void cmd_list_windows_session(struct cmd *, struct session *, ! struct cmd_q *, int); const struct cmd_entry cmd_list_windows_entry = { .name = "list-windows", --- 39,49 ---- "(#{window_panes} panes) " \ "[#{window_width}x#{window_height}] " ! static enum cmd_retval cmd_list_windows_exec(struct cmd *, struct cmdq_item *); ! static void cmd_list_windows_server(struct cmd *, struct cmdq_item *); static void cmd_list_windows_session(struct cmd *, struct session *, ! struct cmdq_item *, int); const struct cmd_entry cmd_list_windows_entry = { .name = "list-windows", *************** *** 59,88 **** }; static enum cmd_retval ! cmd_list_windows_exec(struct cmd *self, struct cmd_q *cmdq) { struct args *args = self->args; if (args_has(args, 'a')) ! cmd_list_windows_server(self, cmdq); else ! cmd_list_windows_session(self, cmdq->state.tflag.s, cmdq, 0); return (CMD_RETURN_NORMAL); } static void ! cmd_list_windows_server(struct cmd *self, struct cmd_q *cmdq) { struct session *s; RB_FOREACH(s, sessions, &sessions) ! cmd_list_windows_session(self, s, cmdq, 1); } static void cmd_list_windows_session(struct cmd *self, struct session *s, ! struct cmd_q *cmdq, int type) { struct args *args = self->args; struct winlink *wl; --- 59,88 ---- }; static enum cmd_retval ! cmd_list_windows_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; if (args_has(args, 'a')) ! cmd_list_windows_server(self, item); else ! cmd_list_windows_session(self, item->state.tflag.s, item, 0); return (CMD_RETURN_NORMAL); } static void ! cmd_list_windows_server(struct cmd *self, struct cmdq_item *item) { struct session *s; RB_FOREACH(s, sessions, &sessions) ! cmd_list_windows_session(self, s, item, 1); } static void cmd_list_windows_session(struct cmd *self, struct session *s, ! struct cmdq_item *item, int type) { struct args *args = self->args; struct winlink *wl; *************** *** 105,116 **** n = 0; RB_FOREACH(wl, winlinks, &s->windows) { ! ft = format_create(cmdq, 0); format_add(ft, "line", "%u", n); format_defaults(ft, NULL, s, wl, NULL); line = format_expand(ft, template); ! cmdq_print(cmdq, "%s", line); free(line); format_free(ft); --- 105,116 ---- n = 0; RB_FOREACH(wl, winlinks, &s->windows) { ! ft = format_create(item, 0); format_add(ft, "line", "%u", n); format_defaults(ft, NULL, s, wl, NULL); line = format_expand(ft, template); ! cmdq_print(item, "%s", line); free(line); format_free(ft);