diff options
author | nicm <nicm> | 2015-12-11 15:46:57 +0000 |
---|---|---|
committer | nicm <nicm> | 2015-12-11 15:46:57 +0000 |
commit | bd5918760ecd1f40a574ccc8a302af869f68c27f (patch) | |
tree | 61937b9355903e6810816eaf4068567df478f36e /cmd-set-hook.c | |
parent | d7e11d0af78bacc7722998509ac93be7fcffc7b4 (diff) | |
download | rtmux-bd5918760ecd1f40a574ccc8a302af869f68c27f.tar.gz rtmux-bd5918760ecd1f40a574ccc8a302af869f68c27f.tar.bz2 rtmux-bd5918760ecd1f40a574ccc8a302af869f68c27f.zip |
We cannot do hooks_find and then hooks_remove because it might have come
from the parent (global) tree, instead make it remove by name like options.
While here, also tidy up a few bits of options and hooks handling (use
RB_FOREACH_SAFE, and a helper function for the free).
Diffstat (limited to 'cmd-set-hook.c')
-rw-r--r-- | cmd-set-hook.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/cmd-set-hook.c b/cmd-set-hook.c index f35e7a0a..ec58418e 100644 --- a/cmd-set-hook.c +++ b/cmd-set-hook.c @@ -93,8 +93,7 @@ cmd_set_hook_exec(struct cmd *self, struct cmd_q *cmdq) name); return (CMD_RETURN_ERROR); } - if ((hook = hooks_find(hooks, name)) != NULL) - hooks_remove(hooks, hook); + hooks_remove(hooks, name); return (CMD_RETURN_NORMAL); } |