summaryrefslogtreecommitdiffstats
path: root/tmux.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2010-06-26 18:20:53 +0000
committerNicholas Marriott <nicm@openbsd.org>2010-06-26 18:20:53 +0000
commit42e24139788d76f00896005df0f745d9e022709a (patch)
treeccc08279c4c2f4162b42b07112ae3fe340c81358 /tmux.c
parentef7293379f00b85cb96dd0dff128bb503e87612b (diff)
Setting the cmdlist pointer in the bind-key to NULL to prevent it being freed
after the command is executing is bogus because it may still be needed if the same command is going to be executed again (for example if you "bind-key a bind-key b ..."). Making a copy is hard, so instead add a reference count to the cmd_list. While here, also print bind-key -n and the rest of the flags properly. Fixes problem reported by mcbride@.
Diffstat (limited to 'tmux.c')
-rw-r--r--tmux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tmux.c b/tmux.c
index 28f822ce..f85a3556 100644
--- a/tmux.c
+++ b/tmux.c
@@ -517,7 +517,7 @@ main(int argc, char **argv)
exit(1);
}
cmdflags &= ~CMD_STARTSERVER;
- TAILQ_FOREACH(cmd, cmdlist, qentry) {
+ TAILQ_FOREACH(cmd, &cmdlist->list, qentry) {
if (cmd->entry->flags & CMD_STARTSERVER)
cmdflags |= CMD_STARTSERVER;
if (cmd->entry->flags & CMD_SENDENVIRON)