=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/Attic/cmd-choose-list.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** src/usr.bin/tmux/Attic/cmd-choose-list.c 2012/09/03 09:57:57 1.1 --- src/usr.bin/tmux/Attic/cmd-choose-list.c 2012/09/03 10:02:39 1.2 *************** *** 1,4 **** ! /* $Id: cmd-choose-list.c,v 1.1 2012/09/03 09:57:57 nicm Exp $ */ /* * Copyright (c) 2012 Thomas Adam --- 1,4 ---- ! /* $Id: cmd-choose-list.c,v 1.2 2012/09/03 10:02:39 nicm Exp $ */ /* * Copyright (c) 2012 Thomas Adam *************** *** 51,58 **** { struct args *args = self->args; struct winlink *wl; ! const char *lists; ! char *template, *list, *copy, *lists1; u_int idx; if (ctx->curclient == NULL) { --- 51,58 ---- { struct args *args = self->args; struct winlink *wl; ! const char *list1; ! char *template, *item, *copy, *list; u_int idx; if (ctx->curclient == NULL) { *************** *** 60,66 **** return (CMD_RETURN_ERROR); } ! if ((lists = args_get(args, 'l')) == NULL) return (CMD_RETURN_ERROR); if ((wl = cmd_find_window(ctx, args_get(args, 't'), NULL)) == NULL) --- 60,66 ---- return (CMD_RETURN_ERROR); } ! if ((list1 = args_get(args, 'l')) == NULL) return (CMD_RETURN_ERROR); if ((wl = cmd_find_window(ctx, args_get(args, 't'), NULL)) == NULL) *************** *** 74,86 **** else template = xstrdup(CMD_CHOOSE_LIST_DEFAULT_TEMPLATE); ! copy = lists1 = xstrdup(lists); idx = 0; ! while ((list = strsep(&lists1, ",")) != NULL) { ! if (*list == '\0') /* no empty entries */ continue; ! window_choose_add_item(wl->window->active, ctx, wl, list, template, idx); idx++; } --- 74,86 ---- else template = xstrdup(CMD_CHOOSE_LIST_DEFAULT_TEMPLATE); ! copy = list = xstrdup(list1); idx = 0; ! while ((item = strsep(&list, ",")) != NULL) { ! if (*item == '\0') /* no empty entries */ continue; ! window_choose_add_item(wl->window->active, ctx, wl, item, template, idx); idx++; }