summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tmux.h
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2010-06-26 18:20:53 +0000
committernicm <nicm@openbsd.org>2010-06-26 18:20:53 +0000
commitdf6e8ae0175bc148ab8129c14214b7845c6be040 (patch)
treea506ead392047a205d40d75eb2eb8fb7dbca131b /usr.bin/tmux/tmux.h
parentUse offsetof() instead of writing our own version (...which generates (diff)
downloadwireguard-openbsd-df6e8ae0175bc148ab8129c14214b7845c6be040.tar.xz
wireguard-openbsd-df6e8ae0175bc148ab8129c14214b7845c6be040.zip
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 'usr.bin/tmux/tmux.h')
-rw-r--r--usr.bin/tmux/tmux.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 7ddb6e0c9d0..d10baf752f9 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.228 2010/06/21 21:44:09 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.229 2010/06/26 18:20:53 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -1161,7 +1161,10 @@ struct cmd {
TAILQ_ENTRY(cmd) qentry;
};
-TAILQ_HEAD(cmd_list, cmd);
+struct cmd_list {
+ int references;
+ TAILQ_HEAD(, cmd) list;
+};
struct cmd_entry {
const char *name;