From 42e24139788d76f00896005df0f745d9e022709a Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sat, 26 Jun 2010 18:20:53 +0000 Subject: 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@. --- tmux.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index 7d6c2e70..6b158cd7 100644 --- a/tmux.h +++ b/tmux.h @@ -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; -- cgit