=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-queue.c,v retrieving revision 1.63 retrieving revision 1.64 diff -c -r1.63 -r1.64 *** src/usr.bin/tmux/cmd-queue.c 2019/04/26 11:38:51 1.63 --- src/usr.bin/tmux/cmd-queue.c 2019/05/03 15:43:01 1.64 *************** *** 1,4 **** ! /* $OpenBSD: cmd-queue.c,v 1.63 2019/04/26 11:38:51 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-queue.c,v 1.64 2019/05/03 15:43:01 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott *************** *** 66,71 **** --- 66,72 ---- item->queue = queue; TAILQ_INSERT_TAIL(queue, item, entry); + log_debug("%s %s: %s", __func__, cmdq_name(c), item->name); item = next; } while (item != NULL); *************** *** 81,98 **** do { next = item->next; ! item->next = NULL; if (c != NULL) c->references++; item->client = c; item->queue = queue; ! if (after->next != NULL) ! TAILQ_INSERT_AFTER(queue, after->next, item, entry); ! else ! TAILQ_INSERT_AFTER(queue, after, item, entry); ! after->next = item; item = next; } while (item != NULL); --- 82,98 ---- do { next = item->next; ! item->next = after->next; ! after->next = item; if (c != NULL) c->references++; item->client = c; item->queue = queue; ! TAILQ_INSERT_AFTER(queue, after, item, entry); ! log_debug("%s %s: %s after %s", __func__, cmdq_name(c), ! item->name, after->name); item = next; } while (item != NULL); *************** *** 170,176 **** TAILQ_REMOVE(item->queue, item, entry); ! free((void *)item->name); free(item); } --- 170,176 ---- TAILQ_REMOVE(item->queue, item, entry); ! free(item->name); free(item); } *************** *** 206,212 **** struct cmdq_item *item, *first = NULL, *last = NULL; struct cmd *cmd; u_int group = cmdq_next_group(); - char *tmp; struct cmdq_shared *shared; shared = xcalloc(1, sizeof *shared); --- 206,211 ---- *************** *** 218,227 **** memcpy(&shared->mouse, m, sizeof shared->mouse); TAILQ_FOREACH(cmd, &cmdlist->list, qentry) { - xasprintf(&tmp, "command[%s]", cmd->entry->name); - item = xcalloc(1, sizeof *item); ! item->name = tmp; item->type = CMDQ_COMMAND; item->group = group; --- 217,224 ---- memcpy(&shared->mouse, m, sizeof shared->mouse); TAILQ_FOREACH(cmd, &cmdlist->list, qentry) { item = xcalloc(1, sizeof *item); ! xasprintf(&item->name, "[%s/%p]", cmd->entry->name, item); item->type = CMDQ_COMMAND; item->group = group; *************** *** 316,327 **** cmdq_get_callback1(const char *name, cmdq_cb cb, void *data) { struct cmdq_item *item; - char *tmp; - xasprintf(&tmp, "callback[%s]", name); - item = xcalloc(1, sizeof *item); ! item->name = tmp; item->type = CMDQ_CALLBACK; item->group = 0; --- 313,321 ---- cmdq_get_callback1(const char *name, cmdq_cb cb, void *data) { struct cmdq_item *item; item = xcalloc(1, sizeof *item); ! xasprintf(&item->name, "[%s/%p]", name, item); item->type = CMDQ_CALLBACK; item->group = 0;