=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-queue.c,v retrieving revision 1.106 retrieving revision 1.107 diff -c -r1.106 -r1.107 *** src/usr.bin/tmux/cmd-queue.c 2021/08/21 10:28:05 1.106 --- src/usr.bin/tmux/cmd-queue.c 2021/08/21 17:25:32 1.107 *************** *** 1,4 **** ! /* $OpenBSD: cmd-queue.c,v 1.106 2021/08/21 10:28:05 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-queue.c,v 1.107 2021/08/21 17:25:32 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott *************** *** 478,483 **** --- 478,490 ---- } } + /* Empty command callback. */ + static enum cmd_retval + cmdq_empty_command(__unused struct cmdq_item *item, __unused void *data) + { + return (CMD_RETURN_NORMAL); + } + /* Get a command for the command queue. */ struct cmdq_item * cmdq_get_command(struct cmd_list *cmdlist, struct cmdq_state *state) *************** *** 487,498 **** const struct cmd_entry *entry; int created = 0; if (state == NULL) { state = cmdq_new_state(NULL, NULL, 0); created = 1; } - cmd = cmd_list_first(cmdlist); while (cmd != NULL) { entry = cmd_get_entry(cmd); --- 494,507 ---- const struct cmd_entry *entry; int created = 0; + if ((cmd = cmd_list_first(cmdlist)) == NULL) + return (cmdq_get_callback(cmdq_empty_command, NULL)); + if (state == NULL) { state = cmdq_new_state(NULL, NULL, 0); created = 1; } while (cmd != NULL) { entry = cmd_get_entry(cmd);